Feature #6276

Gantt Chart rewrite

Added by Eric Davis about 7 years ago. Updated over 6 years ago.

Status:ClosedStart date:2010-09-03
Priority:NormalDue date:
Assignee:Eric Davis% Done:

100%

Category:Issues
Target version:1.1.0
Resolution:Fixed

Description

I've rewritten most of the Gantt chart in Redmine for a client. Basically it makes the Gantt chart support nested charts. There are so many changes, I think a picture is easier to explain.

(Some) Features not shown in the image:

  • Cross project versions
  • New start and end graphics
  • Gravatars for assigned issues
  • Items ordered by due date, start date, and then id
  • Completion bars for Versions and Projects (showing how far along they are)

The PNG and PDF exports are also updated. Though the PDF export still has several bugs in it (many were present before this rewrite).

I'm going to be adding this into trunk for Redmine 1.1. If there are any heavy Gantt chart users who can help test this out, I would appreciate the feedback.

nested-gantt-chart.png - Example nested Gantt chart (annotated) (220 KB) Eric Davis, 2010-09-03 00:47

gantt.rb-1day-coloring.patch Magnifier - fixes coloring of the issues with the same start and end date (1-day tasks) (1.38 KB) Pavel Shalagin, 2011-02-25 10:11


Related issues

Related to Redmine - Defect #6350: New Gantt charts : 500 error when no issue have a due date Closed 2010-09-10
Related to Redmine - Defect #6348: Gantt chart PDF rendering errors Closed 2010-09-10
Related to Redmine - Defect #7335: Sorting issues in gantt by date, not by id Closed 2011-01-15
Related to Redmine - Feature #4786: Gantt Chart - Grouping issues by target version Closed 2010-02-10
Precedes Redmine - Feature #2024: gantt chart editing New

Associated revisions

Revision 4072
Added by Eric Davis about 7 years ago

Rewrite the Gantt chart. #6276

This version of the Gantt chart supports nested charts. So Projects,
Versions, and Issues will be nested underneath their parents correctly.

Additional features:

  • Move all Gantt code to Redmine::Helpers::Gantt class instead of having it in
    the Gantt class, controller, and view
  • Recursive and nest sub-projects
  • Recursive and nest versions
  • Recursive and nest issues
  • Draw a line showing when a Project is active and it's progress
  • Draw a line showing when a Version is active and it's progress
  • Show a version's % complete
  • Change the color of Projects, Versions, and Issues if they are late or
    behind schedule
  • Added Project#start_date and #due_date
  • Added Project#completed_percent
  • Use a mini-gravatar on the Gantt chart
  • Added tests for the Gantt rendering

Revision 4425
Added by Jean-Philippe Lang about 7 years ago

Fixed: new gantt chart discloses all private projects names (#6276).

Revision 4513
Added by Jean-Philippe Lang almost 7 years ago

Adds an application setting to limit the number of items that can be displayed on the gantt chart (#6276).

History

#1 Updated by yusuke kokubo about 7 years ago

+1
looks nice.

#2 Updated by Igor Balk about 7 years ago

yusuke kokubo wrote:

+1
looks nice.

Agreed. Ultimately would be nice to make them editable ie have drag and drop functionality for tasks so you can move them around the chart with you mouse and it will get reflected in the issues.

#3 Updated by Jean-Baptiste Barth about 7 years ago

Looks really nice ! I know some users at my work who are not really happy with current gantt charts, I will relay their feedback as soon as it's in trunk.

#4 Updated by Curtis Stewart about 7 years ago

We use the gantt charts all of the time. Versions are cross-cutting the projects and sub-projects and then we try to roll up to a top level application project. Having a good gantt at the top (like your picture) would really help. While not mentioned in your write-up, don't forget the filtering of tasks (I am sure that it was just cut off of your picture). One of the selling points of Redmine is the ability to filter and organize the issues the way I want, when I want.

If a version is shared outside of one project, how it is shown on the gantt? Do the issues stay with the version or the project on the display?

Do you need the ability to display the project or version on the text of the task or is it a mouse-over that displays the issue details?

Nice job.....

#5 Updated by Eric Davis about 7 years ago

Igor Balk wrote:

Agreed. Ultimately would be nice to make them editable ie have drag and drop functionality for tasks so you can move them around the chart with you mouse and it will get reflected in the issues.

That would be nice but since the charts are "drawn" using HTML spans, it would be difficult to write. I'd accept a patch for it though.

Curtis Stewart wrote:

While not mentioned in your write-up, don't forget the filtering of tasks (I am sure that it was just cut off of your picture). One of the selling points of Redmine is the ability to filter and organize the issues the way I want, when I want.

Yea, that's included. Before showing the issues they are filtered by the current Query.

If a version is shared outside of one project, how it is shown on the gantt? Do the issues stay with the version or the project on the display?

The shared version would appear under it's project. Then issues assigned to it will be shown. Example:

  • Version 1.0 on Project A
    • Issue 100 (on Project A)
    • Issue 101 (on Project A)
    • Project B - Issue 102

Do you need the ability to display the project or version on the text of the task or is it a mouse-over that displays the issue details?

There are tooltips that appear when hovering on an issue (like the existing Gantt). I don't remember if Versions or Projects have tooltips also.

#6 Updated by Arnaud Martel about 7 years ago

Great job!!
I didn't see subtasks but I suppose they are also displayed under the parent task...
I just have one wish: I had to patch the gantt controller to change the way items are ordered (id first, to have items sorted by creation date...) and it will be great if you add the ability to choose how items are sorted.
I will test it as soon as it's in trunk.

#7 Updated by Curtis Stewart about 7 years ago

Great.
Has long as I can figure out which project a task is under when we are doing version work this will really help.

#8 Updated by Igor Balk about 7 years ago

One more thing I would suggest adding is ability to display estimated time vs actual time or just estimated time

#9 Updated by Bruno Samora about 7 years ago

Eric, the Gantt looks perfect!

#10 Updated by Igor Balk about 7 years ago

Eric Davis wrote:

Igor Balk wrote:

Agreed. Ultimately would be nice to make them editable ie have drag and drop functionality for tasks so you can move them around the chart with you mouse and it will get reflected in the issues.

That would be nice but since the charts are "drawn" using HTML spans, it would be difficult to write. I'd accept a patch for it though.

We are thinking about redoing it using Ajax but still not sure about that. Might as well as just do REST client or plugin.

#11 Updated by Eric Davis about 7 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
  • Resolution set to Fixed

Committed the new Gantt chart in r4072, r4073, and r4074.

If you find any bugs, please report them as new bugs and assign them to me. I want to make sure everything gets fixed and don't want to lose any new bug reports that might be posted to this issue.

#12 Updated by Rodrigo Guerrero about 7 years ago

Eric, I update redmine and show me this error with I try to see the gantt:

Processing GanttsController#show (for 192.168.0.100 at 2010-09-10 08:48:46) [GET]
Parameters: {"project_id"=>"TT-09-637-F", "action"=>"show", "controller"=>"gantts"}
Rendering template within layouts/base
Rendering gantts/show

ActionView::TemplateError (undefined method `<=' for nil:NilClass) on line #155 of app/views/gantts/show.html.erb:
152:
153: <% top = headers_height + 10 >
154:
155: <
= @gantt.lines(:top => top, :zoom => zoom, :g_width => g_width ) >
156:
157: <

158: #

lib/redmine/helpers/gantt.rb:301:in `line_for_project'
lib/redmine/helpers/gantt.rb:172:in `render_project'
lib/redmine/helpers/gantt.rb:194:in `render_project'
lib/redmine/helpers/gantt.rb:193:in `render_project'
lib/redmine/helpers/gantt.rb:151:in `lines'
app/views/gantts/show.html.erb:155
app/controllers/gantts_controller.rb:26
app/controllers/gantts_controller.rb:25:in `show'
passenger (2.2.9) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
passenger (2.2.9) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:400:in `start_request_handler'
passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:351:in `handle_spawn_application'
passenger (2.2.9) lib/phusion_passenger/utils.rb:184:in `safe_fork'
passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:349:in `handle_spawn_application'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:163:in `start'
passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:209:in `start'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

Rendering /redmine_ny2/public/500.html (500 Internal Server Error)

#13 Updated by Igor Kalashnikov about 7 years ago

The same for me. Error is thrown not on all projects.

Processing GanttsController#show (for 172.16.1.195 at 2010-09-10 14:22:47) [GET]
  Parameters: {"action"=>"show", "controller"=>"gantts"}
Rendering template within layouts/base
Rendering gantts/show

ActionView::TemplateError (undefined method `<=' for nil:NilClass) on line #155 of app/views/gantts/show.html.erb:
152:
153: <% top = headers_height + 10 %>
154:
155: <%= @gantt.lines(:top => top, :zoom => zoom, :g_width => g_width ) %>
156:
157: <%
158: #

    lib/redmine/helpers/gantt.rb:301:in `line_for_project'
    lib/redmine/helpers/gantt.rb:172:in `render_project'
    lib/redmine/helpers/gantt.rb:194:in `render_project'
    lib/redmine/helpers/gantt.rb:193:in `render_project'
    lib/redmine/helpers/gantt.rb:154:in `lines'
    lib/redmine/helpers/gantt.rb:153:in `lines'
    app/views/gantts/show.html.erb:155
    app/controllers/gantts_controller.rb:26:in `show'
    app/controllers/gantts_controller.rb:25:in `show'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/rack/request_handler.rb:92:in `process_request'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/railz/application_spawner.rb:213:in `start'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
    /usr/lib/ruby/site_ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
    /usr/lib/phusion_passenger/passenger-spawn-server:61

Rendering /opt/redmine/public/500.html (500 Internal Server Error)

#14 Updated by Pieter Nicolai about 7 years ago

This happens when none of the issues in a project have a due date set. I created a quick patch, see also Issue #6350

#15 Updated by Eric Davis about 7 years ago

Eric Davis wrote:

If you find any bugs, please report them as new bugs and assign them to me. I want to make sure everything gets fixed and don't want to lose any new bug reports that might be posted to this issue.

Please please please, open new issues if you find bugs. I cannot stress this enough. Posting the bugs to this issue will cause them to get lost, and then they will help no one.

#16 Updated by Mischa The Evil about 7 years ago

Eric Davis wrote:

Igor Balk wrote:

Agreed. Ultimately would be nice to make them editable ie have drag and drop functionality for tasks so you can move them around the chart with you mouse and it will get reflected in the issues.

That would be nice but since the charts are "drawn" using HTML spans, it would be difficult to write. I'd accept a patch for it though.

Eric, have you reviewed the patches from #2024? Would such be easy to adopt and maintained post Gantt-rewrite?

#17 Updated by Pavel Shalagin over 6 years ago

Eric, thank you very much for the Gantt update - like it much better than the previous one.

Don't know if it can be considered as a problem, but -
the tasks with the same start_date and end_date seems not to be colored of progress and late correctly on the diagram. They all are just grey.

I would suggest some changes (please see the patch).

Cheers,
Pavel

#18 Updated by Go MAEDA 4 months ago

  • Related to Feature #4786: Gantt Chart - Grouping issues by target version added

Also available in: Atom PDF