Vote #74241
完了Allow a bigger range for the gantt timeline
0%
説明
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).
journals
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.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Hi
has this issue still not been solved?
it is important to allow the view of more years in the Gantt diagram
nico
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Added "Maximum number of months displayed on the gantt chart" to [Settings] > [Issue tracking].
!{width:50%;border:1px solid #ccc;}settings_gantt_months_limit.png!
Make this value the maximum number of months for the Gantt chart.
!{width:50%;border:1px solid #ccc;}gantt.png!
I attached a patch.
--------------------------------------------------------------------------------
Here is a test for the patch attached in #14654#note-6.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
Setting the target version to 4.1.0.
--------------------------------------------------------------------------------
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).
--------------------------------------------------------------------------------
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 (attachment:14654.patch). Marius, what do you think about this approach?
--------------------------------------------------------------------------------
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 (attachment:14654.patch). Marius, what do you think about this approach?
No problem for me.
--------------------------------------------------------------------------------
Committed the patches.
--------------------------------------------------------------------------------
related_issues
relates,New,9296,User preference for storing offset of month in Gantt
duplicates,Closed,24550,Open GANTT for more than 24months