Project

General

Profile

Graphs plugin

Added by Brad Beattie over 15 years ago

Hey folks, I'm working on a graphs plugin for Redmine that augments the exiting SVG use (like in repository statistics). Attached is the first instance I've implemented: a graph of issues over time for a given target version.

Is there anything else anyone wants? These things seem relatively easy to implement.


Replies (104)

RE: Graphs plugin - Added by Peter Fern about 15 years ago

Peter Fern wrote:

Based on your fix, fix other instances too:

Actually, that doesn't look so good, however evdavis10's branch (http://github.com/edavis10/redmine-graphs-plugin) works on trunk, so probably just pull his stuff in.

RE: Graphs plugin - Added by ciaran jessup about 15 years ago

Peter Fern wrote:

Peter Fern wrote:

Based on your fix, fix other instances too:

Actually, that doesn't look so good, however evdavis10's branch (http://github.com/edavis10/redmine-graphs-plugin) works on trunk, so probably just pull his stuff in.

I've merged edavis10's master branch head into my own now (I've not tested that it actually works mind) so my code now be as 'good as' Eric's branch but with the browser independence patch in it (hopefully, I'm still more Git's victim than it's master!)

Fwiw i've parked any work on this branch until http://www.redmine.org/issues/3861 is resolved one way or the other , as if that patch is accepted there will be a standard way of providing platform independent graphics across the redmine tool, rather than having to do the same work in every plugin out there! Feel free to vote on this issue if you care about this (you should do! )

RE: Graphs plugin - Added by ciaran jessup about 15 years ago

sunday walker wrote:

Patch for MS IE (No need the SVG plugin) .

Related (Need SIE)
http://www.redmine.org/issues/3414#note-2

This would be a better solution than my proposal if it works as well. I've not come across SIE before and I speak no japanese what is it exactly?

RE: Graphs plugin - Added by sunday walker about 15 years ago

ciaran jessup wrote:

This would be a better solution than my proposal if it works as well.
I've not come across SIE before and I speak no japanese what is it exactly?

No problem.
I am the same, too.
I can hardly speak English. (line a baby.)

Please apply the patch.

Related (Need SIE) http://www.redmine.org/issues/3414#note-2

Or, Please deploy below an attached file.
redmine/public/javascripts/sie.js

The following machine translation may help your understanding.
http://honyaku.yahoofs.jp/url_result?ctw_=sT,eCR-JE,bF,hT,uaHR0cDovL3NpZS5zb3VyY2Vmb3JnZS5qcC8=,qlang=ja|for=0|sp=-5|fs=100%|fb=0|fi=0|fc=FF0000|db=T|eid=CR-EJ,k92b9f2b253bd3b84697c16cd988cb2c5,t20091028072944,

sie.js (67 KB) sie.js

RE: Graphs plugin - Added by sunday walker about 15 years ago

Japanese lang files.

config/locales/ja.yml

ja:
  label_graphs: グラフ
  label_graphs_total_vs_closed_issues: 全チケットと終了チケット
  label_graphs_old_issues: 放置された未完了チケット
  label_graphs_issue_growth: 全チケットの時間変化
  label_graphs_issue_status_flow: 最近のステータス変化 (24時間以内)
  label_graphs_assigned_to_status_flow: 最近の担当者変化 (24時間以内)
  warning_no_issues: グラフに対応するチケットがありません。

lang/ja.yml

label_graphs: グラフ
label_graphs_total_vs_closed_issues: 全チケットと終了チケット
label_graphs_old_issues: 放置された未完了チケット
label_graphs_issue_growth: 全チケットの時間変化
label_graphs_issue_status_flow: 最近のステータス変化 (24時間以内)
label_graphs_assigned_to_status_flow: 最近の担当者変化 (24時間以内)
warning_no_issues: グラフに対応するチケットがありません。

RE: Graphs plugin - Added by sunday walker about 15 years ago

sunday walker wrote:

Patch for MS IE (No need the SVG plugin) .

Related (Need SIE)
http://www.redmine.org/issues/3414#note-2

I forgot some changes.

RE: Graphs plugin - Added by ciaran jessup about 15 years ago

sunday walker wrote:

ciaran jessup wrote:

This would be a better solution than my proposal if it works as well.
I've not come across SIE before and I speak no japanese what is it exactly?

No problem.
I am the same, too.
I can hardly speak English. (line a baby.)

Please apply the patch.

Related (Need SIE) http://www.redmine.org/issues/3414#note-2

Or, Please deploy below an attached file.
redmine/public/javascripts/sie.js

The following machine translation may help your understanding.
http://honyaku.yahoofs.jp/url_result?ctw_=sT,eCR-JE,bF,hT,uaHR0cDovL3NpZS5zb3VyY2Vmb3JnZS5qcC8=,qlang=ja|for=0|sp=-5|fs=100%|fb=0|fi=0|fc=FF0000|db=T|eid=CR-EJ,k92b9f2b253bd3b84697c16cd988cb2c5,t20091028072944,

I've pushed your patches up onto one of my github branches so people can experiment if they wish, this approach looks to be better than my proposed approach using svgweb, no flash dependency!

RE: Graphs plugin - Added by ciaran jessup about 15 years ago

sunday walker wrote:

sunday walker wrote:

Patch for MS IE (No need the SVG plugin) .

Related (Need SIE)
http://www.redmine.org/issues/3414#note-2

I forgot some changes.

I've applied this patch on my github fork of redmine_graph_plugin here : http://github.com/ciaranj/redmine-graphs-plugin/tree/sie_test

I had to make a minor modification to your patch as it was not correctly creating the content_tags for the 'my blocks', this is including in my git commit.

Also the sie rendering of the 'Recent assignment changes' within ie for me is incorrect. I get 1 circle (I have one user) in firefox, but the same circle duplicated in Ie6!!?

RE: Graphs plugin - Added by sunday walker about 15 years ago

ciaran jessup wrote:

I've applied this patch on my github fork of redmine_graph_plugin
here : http://github.com/ciaranj/redmine-graphs-plugin/tree/sie_test

I had to make a minor modification to your patch as it was not correctly creating
the content_tags for the 'my blocks', this is including in my git commit.

Also the sie rendering of the 'Recent assignment changes' within ie for me is incorrect.
I get 1 circle (I have one user) in firefox, but the same circle duplicated in Ie6!!?

Thank you.

I do not understand all functions.

Please teach a procedure (or steps) to arrive at the screen.
Please teach the example of the screen. (Right screen shoot)
Please teach source code names (path) that you think may be related.

RE: Graphs plugin - Added by sunday walker about 15 years ago

sunday walker wrote:

Please teach source code names (path) that you think may be related.

and function (or method) names.

RE: Graphs plugin - Added by sunday walker about 15 years ago

The following may become the hint of the usage of SIE.
I am not an author of SIE.
Therefore, there may or may not be wrong.

  • Please do not use the CSS.
    *** app/controllers/graphs_controller.rb    Sat Jun 13 16:02:58 2009
    --- app/controllers/graphs_controller.rb    Tue Oct 27 21:55:49 2009
    ***************
    *** 92,98 ****
                  :show_data_points => false,
                  :show_data_values => false,
                  :stagger_x_labels => true,
    !             :style_sheet => "/plugin_assets/redmine_graphs/stylesheets/issue_growth.css",
                  :width => 720,
                  :x_label_format => "%Y-%m-%d" 
              })
    --- 92,98 ----
                  :show_data_points => false,
                  :show_data_values => false,
                  :stagger_x_labels => true,
    ! #            :style_sheet => "/plugin_assets/redmine_graphs/stylesheets/issue_growth.css",
                  :width => 720,
                  :x_label_format => "%Y-%m-%d" 
              })
    
  • Please do not use the CSS.
    Index: app/controllers/repositories_controller.rb
    ===================================================================
    --- app/controllers/repositories_controller.rb    (revision 2980)
    +++ app/controllers/repositories_controller.rb    (working copy)
    @@ -249,6 +249,7 @@
           :scale_integers => true,
           :step_x_labels => 2,
           :show_data_values => false,
    +      :no_css => true,
           :graph_title => l(:label_commits_per_month),
           :show_graph_title => true
         )
    
  • Please use '<object ...></objct>'.
  • Please use 'data'
    *** app/views/graphs/old_issues.html.erb    Sat Jun 13 16:02:58 2009
    --- app/views/graphs/old_issues.html.erb    Mon Oct 26 22:35:25 2009
    ***************
    *** 1,7 ****
      <h2><%= l(:label_graphs_old_issues) %></h2>
      <% unless @issues_by_created_on.empty? %>
    !     <%= tag("embed", :width => "100%", :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'graphs', :action => 'issue_age_graph')) if @project.nil? %>
    !     <%= tag("embed", :width => "100%", :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'graphs', :action => 'issue_age_graph', :project_id => @project.id)) unless @project.nil? %>
      <% end %>
    
      <div class="splitcontentleft">
    --- 1,7 ----
      <h2><%= l(:label_graphs_old_issues) %></h2>
      <% unless @issues_by_created_on.empty? %>
    !     <%= content_tag("object", "", :width => "100%", :height => 300, :type => "image/svg+xml", :data => url_for(:controller => 'graphs', :action => 'issue_age_graph')) if @project.nil? %>
    !     <%= content_tag("object", "", :width => "100%", :height => 300, :type => "image/svg+xml", :data => url_for(:controller => 'graphs', :action => 'issue_age_graph', :project_id => @project.id)) unless @project.nil? %>
      <% end %>
    
      <div class="splitcontentleft">
    
  • Please use '<script defer="defer" type="text/javascript" src="/javascripts/sie.js"></script>'.
    ***************
    *** 34,37 ****
    
      <% content_for :sidebar do %>
          <%= render :partial => 'issues/sidebar' %>
    ! <% end %>
    \ No newline at end of file
    --- 34,42 ----
    
      <% content_for :sidebar do %>
          <%= render :partial => 'issues/sidebar' %>
    ! <% end %>
    ! 
    ! 
    ! <% content_for :header_tags do %>
    !     <%= javascript_include_tag 'sie', :defer => "defer" %>
    ! <% end %>
    

RE: Graphs plugin - Added by sunday walker about 15 years ago

sunday walker wrote:

  • Please use '<object ...></objct>'.

typo.

  • Please use '<object ...></object>'.

RE: Graphs plugin - Added by sunday walker about 15 years ago

Would you please add the following features.

  • The reliability growth curve of each version
    • Similar to 'Total issues vs. Closed issues'
    • Only count tracker value is 'Bug'
    • Display on the page same as 'Total issues vs. Closed issues'

RE: Graphs plugin - Added by ciaran jessup about 15 years ago

sunday walker wrote:

ciaran jessup wrote:

I've applied this patch on my github fork of redmine_graph_plugin
here : http://github.com/ciaranj/redmine-graphs-plugin/tree/sie_test

I had to make a minor modification to your patch as it was not correctly creating
the content_tags for the 'my blocks', this is including in my git commit.

Also the sie rendering of the 'Recent assignment changes' within ie for me is incorrect.
I get 1 circle (I have one user) in firefox, but the same circle duplicated in Ie6!!?

Thank you.

I do not understand all functions.

Please teach a procedure (or steps) to arrive at the screen.
Please teach the example of the screen. (Right screen shoot)
Please teach source code names (path) that you think may be related.

I've fixed the issue in this commit : http://github.com/ciaranj/redmine-graphs-plugin/commit/d3893fa85f4d97c06de79d2e12021526e7576657

If sie.js is imported multiple times then it can cause rendering issues with the SVG (one of the my blocks appeared twice!)

With this fix in I'm pretty impressed with SIE, the lack of a flash requirement (svgweb) is a winner for me :)

RE: Graphs plugin - Added by sunday walker about 15 years ago

ciaran jessup wrote:

I've fixed the issue in this commit :
http://github.com/ciaranj/redmine-graphs-plugin/commit/d3893fa85f4d97c06de79d2e12021526e7576657

If sie.js is imported multiple times then it can cause rendering issues with
the SVG (one of the my blocks appeared twice!)

Great !!

RE: Graphs plugin - Added by sunday walker about 15 years ago

sunday walker wrote:

Would you please add the following features.

  • The reliability growth curve of each version
    • Similar to 'Total issues vs. Closed issues'
    • Only count tracker value is 'Bug'
    • Display on the page same as 'Total issues vs. Closed issues'
  • Only count tracker value is 'Bug'
  • count tracker value is selectable (All, 'Bug', 'Fuature' or others)

RE: Graphs plugin - Added by Kevin Bosman almost 15 years ago

Thomas M wrote:

I'm running current Trunk and I'm always having the "Black Background & No Style" error.

By the way commenting :no_css and :style_sheet in graph_controller.rb gives the graphs back.

It seems to me that Firefox 3.5.5 on Windows does not provide a default set of styles for SVG, thus resulting in black graphs.

Thomas M's solution above does work around this, however it then renders with a completely default set of styles and loses the advantage of Brad Beattie's excellent customised style overrides.

Instead of modifying graph_controller.rb, you can simply include the default set of SVG styles in the CSS files, which should theoretically work across all combinations of browser & OS.

I've attached herewith a default set of SVG styles in a new file svg_default.css, plus included @import url(svg_default.css) at the top of each of the original css files to import the defaults.
(These files should all go into vendor/plugins/redmine_graphs/assets/stylesheets - a restart will be required)

stylesheets.tar.gz (1.19 KB) stylesheets.tar.gz Updated stylesheets

RE: Graphs plugin - Added by Nanda P almost 15 years ago

With the Updated stylesheets, When I try to view the Roadmap,

On "Total issues vs. Closed issues" block I am getting this message.

Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your redMine administrator for assistance.

Here is my error log:

Processing GraphsController#target_version_graph (for 10.10.2.25 at 2009-12-07 10:53:50) [GET]
  Parameters: {"action"=>"target_version_graph", "id"=>"19", "controller"=>"graphs"}

NoMethodError (undefined method `keys' for #<Array:0x853e604>):
  vendor/plugins/redmine_graphs/app/controllers/graphs_controller.rb:170:in `target_version_graph'
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
  C:/Program Files/Ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'

Rendering C:/Program Files/redmine/current/public/500.html (500 Error)
rendering section "request" 
rendering section "session" 
rendering section "environment" 
rendering section "backtrace" 

RE: Graphs plugin - Added by Kevin Bosman almost 15 years ago

Nanda Palaniswamy wrote:

With the Updated stylesheets, When I try to view the Roadmap,

On "Total issues vs. Closed issues" block I am getting this message.

[...]

That error is unlikely to have been caused by the updated stylesheets. It may be somehow related to this bug: http://github.com/edavis10/redmine-graphs-plugin/commit/3bf4cea86d6844230efc79703a74d94f4f3aeee0

Have you tried updating to a newer revision? I'm running master from the nikosd fork with Redmine trunk on Rails 2.3.4

RE: Graphs plugin - Added by Steve Overton almost 15 years ago

I just installed the latest git version of the plugin onto redmine stack 0.8.7. and the graphs render perfectly from Firefox but the graphs are not displaying from IE8. I do not receive any errors. I have attached a screen shot of the display and the production log does not jump out at me. I am new to Redmine so I'm not really sure what I'm looking at.

Here is the product log entry for the graphs controller:

Processing GraphsController#old_issues (for 10.166.12.31 at 2009-12-23 08:24:05) [GET]
Session ID: 17177895445134c15bc6e989253662bb
Parameters: {"project_id"=>"jpats", "action"=>"old_issues", "controller"=>"graphs"}
Rendering template within layouts/base
Rendering graphs/old_issues
Completed in 0.21800 (4 reqs/sec) | Rendering: 0.06200 (28%) | DB: 0.15600 (71%) | 200 OK [http://pcname/redmine/projects/jpats/issues/old]

Any ideas? Thanks,
Steve

RE: Graphs plugin - Added by Anonymous almost 15 years ago

I have the identical problem on IE 8.
On Firefox 3.5.x, the graphs do not render correctly (see screenshots).

screenshot1.jpg (37 KB) screenshot1.jpg Screenshot of open ageing issues
screenshot2.jpg (24.4 KB) screenshot2.jpg Screenshot of issues over time

RE: Graphs plugin - Added by Kevin Bosman almost 15 years ago

Steve & Kunal,

All versions of IE, including IE8, are not by default capable of viewing SVG images. IE is the only major browser that still does not support this standard.

For IE, there are several third party solutions available for solving the problem, which mostly require installing a plugin into each browser on which you need to view the graphs. We are successfully using the Renesis SVG viewer plugin for IE, which you can get from http://www.examotion.com/index.php?id=product_player_download

Kunal, to remedy your Firefox display problem, I would recommend copying over the updated files as per my post above, or use the attached patch.

redmine_graphs-defaultsvg-css.patch (6.09 KB) redmine_graphs-defaultsvg-css.patch CSS patch for SVG Graphs on Firefox

RE: Graphs plugin - Added by Anonymous almost 15 years ago

Thanks Kevin! Worked like a charm!

(76-100/104)