Project

General

Profile

Actions

Feature #14654

closed

Allow a bigger range for the gantt timeline

Added by Michael Heinze over 10 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Gantt
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
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).


Files

settings_gantt_months_limit.png (105 KB) settings_gantt_months_limit.png Yuichi HARADA, 2019-04-26 04:45
gantt.png (61.6 KB) gantt.png Yuichi HARADA, 2019-04-26 04:46
14654.patch (2.95 KB) 14654.patch Yuichi HARADA, 2019-04-26 04:52
test-for-14654.patch (1.12 KB) test-for-14654.patch Go MAEDA, 2019-04-26 08:17
14654_v2.patch (2.97 KB) 14654_v2.patch Yuichi HARADA, 2019-05-07 07:53

Related issues

Related to Redmine - Feature #9296: User preference for storing offset of month in GanttNew2011-09-21

Actions
Has duplicate Redmine - Feature #24550: Open GANTT for more than 24monthsClosed

Actions
Actions #1

Updated by Daniel Felix over 10 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.

Actions #2

Updated by Liangfu Chen over 9 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.

Actions #3

Updated by Toshi MARUYAMA over 9 years ago

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

Updated by nico cruz almost 7 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

Actions #5

Updated by Go MAEDA over 6 years ago

  • Has duplicate Feature #24550: Open GANTT for more than 24months added
Actions #6

Updated by Yuichi HARADA almost 5 years 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.

Actions #7

Updated by Go MAEDA almost 5 years ago

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

Actions #8

Updated by Go MAEDA almost 5 years 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.

Actions #9

Updated by Yuichi HARADA almost 5 years 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.

Actions #10

Updated by Go MAEDA almost 5 years 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.

Actions #11

Updated by Marius BĂLTEANU almost 5 years 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).

Actions #12

Updated by Go MAEDA almost 5 years ago

  • Assignee set to Marius BĂLTEANU

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?

Actions #13

Updated by Marius BĂLTEANU almost 5 years 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.

Actions #14

Updated by Go MAEDA almost 5 years ago

  • Status changed from New to Closed
  • Assignee changed from Marius BĂLTEANU to Go MAEDA
  • Resolution set to Fixed

Committed the patches.

Actions

Also available in: Atom PDF