Skip to main content

auto_scheduling

info

This functionality is available in the PRO edition only.

Description​

Enables auto scheduling

auto_scheduling: AutoSchedulingConfig | boolean

Example​

gantt.config.auto_scheduling = {
enabled: true,
gap_behavior: "compress"
};

gantt.init("gantt_here");

Default value: false

Details​

note

This config is defined in the auto_scheduling extension, so you need to activate the auto_scheduling plugin. Read the details in the Auto Scheduling article.

While auto_scheduling config can be set as a boolean, usage of the object definition is the recommended approach for configuring the auto-scheduling behavior.

When set as an object, the following options are available:

enabled​

Type: boolean

Default: false

Turns auto-scheduling on or off (same as using a boolean value directly).

gantt.config.auto_scheduling = {
enabled: true
};

apply_constraints​

Type: boolean

Default: true

Enables or disables usage of time constraints for auto scheduling.

gantt.config.auto_scheduling = {
enabled: true,
apply_constraints: false
};

Setting the value to false switches auto scheduling to the mode that ignores constraints associated with tasks (e.g. ASAP, ALAP, SNET, etc.) and scheduling depends solely on task dependencies.

This property replaces the deprecated auto_scheduling_compatibility setting.

gap_behavior​

Type: String

Allowed values: "preserve"|"compress"

Default: "preserve"

Defines how Gantt handles gaps between dependent tasks during scheduling.

  • "preserve" - keeps tasks in their current positions if there are no conflicts
  • "compress" - moves tasks to the earliest allowed date (or latest if schedule_from_end is enabled)

By default, tasks are only rescheduled when their current date violates a constraint or dependency.

gantt.config.auto_scheduling = {
enabled: true,
apply_constraints: false,
gap_behavior: "compress"
};

Type: boolean

Default: false

Allows or forbids creating links between parent tasks (projects) and their subtasks.

By default, such links can't be created.

gantt.config.auto_scheduling = {
enabled: true,
apply_constraints: false,
descendant_links: true
};

schedule_on_parse​

Type: boolean

Default: true

Defines whether Gantt will do auto-scheduling on data loading/parsing.

gantt.config.auto_scheduling = {
enabled: true,
schedule_on_parse: false
};

move_projects​

Type: boolean

Default: true

By default (when the property is set to true), the whole project is moved during auto scheduling. It means that all tasks in the project remain on their places relative to each other and the beginning of the project.

moving_project_true

If the move_projects property is set to false, auto scheduling will move separate tasks inside of the project. Thus, some tasks will be moved, others will remain on their places.

moving_project_false

note

If you use the constraint scheduling (apply_constraints: true), the move_projects config will be active only when the gap_behavior property is set to "preserve"`:

gantt.config.auto_scheduling = {
enabled: true,
apply_constraints: true,
move_projects: true,
gap_behavior: "preserve"
};

use_progress​

Type: boolean

Default: false

Specifies whether completed tasks should affect scheduling and critical path calculations.

gantt.config.auto_scheduling = {
enabled: true,
use_progress: true
};

When the property is enabled, the critical path, slack, and auto scheduling algorithms will take the value of the task progress into account, similar to how these methods work in MS Project, namely:

  1. Completed tasks (completed tasks - the tasks with 100% progress) always have zero slack;

  2. Completed tasks are excluded from the auto scheduling calculations. Relations that connect predecessors to completed tasks are ignored;

  3. Completed tasks can't be critical.

schedule_from_end​

Type: boolean

Default: false

Enables backward scheduling.

Setting this config to true will switch auto scheduling to the as late as possible mode.

The value will be only applied if project_end is specified as well.

gantt.config.project_end = new Date(2025, 10, 1);
gantt.config.auto_scheduling = {
enabled: true,
schedule_from_end: true
};

project_constraint​

Type: boolean

Default: false

Defines whether tasks should inherit the constraint type from their parent project.

gantt.config.auto_scheduling = {
enabled: true,
project_constraint: true
};

By default, the constraint type of the parent project doesn't affect the constraint type of its nested tasks.

If you set the config to true, the child tasks (except for tasks with their own constraint type) will have the same constraint type as their parent project (for example, finish no later than).

show_constraints​

Type: boolean

Default: false

Controls the display of task constraints on the Gantt chart. Set to true to display constraints or false to hide them.

For example, to enable auto-scheduling but disable the display of task constraints:

gantt.config.auto_scheduling = {
enabled: true,
show_constraints: false
};
gantt.init("gantt_here");

strict_calendar​

Type: boolean

Default: false

Controls whether a task landing on its own non-working time is reported as a conflict.

gantt.config.auto_scheduling = {
enabled: true,
strict_calendar: true
};

When set to true, the onAutoScheduleConflict event fires (with kind: "calendar-non-working") whenever scheduling moves a task onto its own non-working time. The task date is applied in both modes - this option only controls whether the situation is reported, so you can surface it in the UI.

Change log​

  • the strict_calendar option has been added in v10.0
  • since v9.1, using the object configuration for auto_scheduling is the recommended approach
  • Can be set as an object since v9.0
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.