Feature #14654

Allow a bigger range for the gantt timeline

Added by Michael Heinze almost 6 years ago. Updated 2 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Gantt
Target version:4.1.0
Resolution:Fixed

Description

Currently the gantt chart can only display up to 24 months. Every bigger value is ignored and sets the chart back to 6 months.
There is no obvious reason for this constraint, so the possible range should be extended to more than 24 months (maybe 48 or a configurable value).

settings_gantt_months_limit.png (105 KB) Yuichi HARADA, 2019-04-26 04:45

gantt.png (61.6 KB) Yuichi HARADA, 2019-04-26 04:46

14654.patch Magnifier (2.95 KB) Yuichi HARADA, 2019-04-26 04:52

test-for-14654.patch Magnifier (1.12 KB) Go MAEDA, 2019-04-26 08:17

14654_v2.patch Magnifier (2.97 KB) Yuichi HARADA, 2019-05-07 07:53


Related issues

Related to Redmine - Feature #9296: User preference for storing offset of month in Gantt New 2011-09-21
Duplicated by Redmine - Feature #24550: Open GANTT for more than 24months Closed

Associated revisions

Revision 18136
Added by Go MAEDA 2 months ago

Allow a bigger range for the gantt timeline (#14654).

Patch by Yuichi HARADA.

Revision 18137
Added by Go MAEDA 2 months ago

Test for r18136 (#14654).

Patch by Go MAEDA.

Revision 18138
Added by Go MAEDA 2 months ago

Update locales (#14654).

History

#1 Updated by Daniel Felix almost 6 years ago

The limitation is set in this file and line: source:trunk/lib/redmine/helpers/gantt.rb#L65

You can set this value (the second one in the if) to a higher value, for example 49 to define 4 years on a gantt.

Maybe this could be set per option, but this would be a workaround for you to get started.

#2 Updated by Liangfu Chen over 4 years ago

Daniel Felix wrote:

The limitation is set in this file and line: source:trunk/lib/redmine/helpers/gantt.rb#L65

You can set this value (the second one in the if) to a higher value, for example 49 to define 4 years on a gantt.

Maybe this could be set per option, but this would be a workaround for you to get started.

after i modified the line and restarted apache2, it still wouldn't work at all.

i thought there is some problem with the cache, but i've cleared it. left the problem unsolved.

#3 Updated by Toshi MARUYAMA over 4 years ago

  • Related to Feature #9296: User preference for storing offset of month in Gantt added

#4 Updated by nico cruz about 2 years ago

Hi

has this issue still not been solved?
it is important to allow the view of more years in the Gantt diagram

nico

#5 Updated by Go MAEDA over 1 year ago

  • Duplicated by Feature #24550: Open GANTT for more than 24months added

#6 Updated by Yuichi HARADA 3 months ago

Added "Maximum number of months displayed on the gantt chart" to [Settings] > [Issue tracking].

Make this value the maximum number of months for the Gantt chart.

I attached a patch.

#7 Updated by Go MAEDA 3 months ago

Here is a test for the patch attached in #14654#note-6.

#8 Updated by Go MAEDA 3 months ago

  • Status changed from New to Needs feedback

Thank you for the patch.

We should consider the behavior when Setting.gantt_months_limit is less than 6.

Assume that Setting.gantt_months_limit is 0. You will see a chart with 6 months long. But you cannot enter the value between 1 and 6 to input#months. In other words, you see 6 months chart but you cannot make the gantt shorter, for example, 5 months. I think the behavior is strange.

Maybe it is better to have a lower limit of Setting.gantt_months_limit. In my opinion, gantt should behave as if Setting.gantt_months_limit is 6 when Setting.gantt_months_limit is less than 6.

I think the lower limit should be 6.

#9 Updated by Yuichi HARADA 2 months ago

Go MAEDA wrote:

Maybe it is better to have a lower limit of Setting.gantt_months_limit. In my opinion, gantt should behave as if Setting.gantt_months_limit is 6 when Setting.gantt_months_limit is less than 6.

I think the lower limit should be 6.

Thank you for pointing out.
If Setting.gantt_months_limit is less than 6, gantt has rebuilt the patch to behave as if Setting.gantt_months_limit is 6.

#10 Updated by Go MAEDA 2 months ago

  • Status changed from Needs feedback to New
  • Target version changed from Candidate for next major release to 4.1.0

Setting the target version to 4.1.0.

#11 Updated by Marius BALTEANU 2 months ago

We should move [6, Setting.gantt_months_limit.to_i].max to a method in order to avoid duplicating the logic in two places (view and lib).

#12 Updated by Go MAEDA 2 months ago

  • Assignee set to Marius BALTEANU

Marius BALTEANU wrote:

We should move [6, Setting.gantt_months_limit.to_i].max to a method in order to avoid duplicating the logic in two places (view and lib).

I think it is a bit overkill to add a method somewhere. Since the problem I pointed out in #14654#note-8 is really small, I think it is OK to apply the first patch (14654.patch). Marius, what do you think about this approach?

#13 Updated by Marius BALTEANU 2 months ago

Go MAEDA wrote:

Marius BALTEANU wrote:

We should move [6, Setting.gantt_months_limit.to_i].max to a method in order to avoid duplicating the logic in two places (view and lib).

I think it is a bit overkill to add a method somewhere. Since the problem I pointed out in #14654#note-8 is really small, I think it is OK to apply the first patch (14654.patch). Marius, what do you think about this approach?

No problem for me.

#14 Updated by Go MAEDA 2 months ago

  • Status changed from New to Closed
  • Assignee changed from Marius BALTEANU to Go MAEDA
  • Resolution set to Fixed

Committed the patches.

Also available in: Atom PDF