fit_tasks

'says' the Gantt chart to automatically extend the time scale in order to fit all displayed tasks

boolean fit_tasks;

Example

gantt.config.fit_tasks = true; gantt.init("gantt_here");


Default value:

false

Related samples

Details

By default, dhtmlxGantt doesn't automatically extend the time scale, if some task no longer fits into the current interval. This can happen when a user sets the task date or after auto scheduling. In that case the task bar can be truncated or not visible at all.

To 'force' the scale re-render each time a task doesn't fit into the existing scale interval, set the fit_tasks property to true.

This setting can be canceled by the start_date and end_date configs, which will limit the time scale to specified boundaries.

If you want the time scale to be dynamically adjusted according to the date range, you can either skip the start_date and end_date configs or manage the time range dynamically.


For example, the initial duration of the task "Project #2" is 6 days.

If the user makes the duration longer by setting it say to 8 days, the Gantt chart will behave differently, depending on the value of the fit_tasks property:

  • gantt.config.fit_tasks = false; (default value)

  • gantt.config.fit_tasks = true;

See also
Back to top