Execution Context
The Gantt Config Script runs once during chart initialization on the client side. It has access to thegantt object and its configuration properties.
The Gantt Config Script executes before the chart renders data. Modifications to
gantt.config and gantt.templates take effect on the initial render. To apply changes after initialization, call gantt.render().Configuration Properties (gantt.config)
Control Gantt behavior by settinggantt.config.* properties:
Interaction Properties
| Property | Type | Default | Description |
|---|---|---|---|
gantt.config.drag_links | Boolean | true | Enable or disable creating dependency links by dragging between task bars. Set to false to prevent users from creating links. |
gantt.config.drag_progress | Boolean | true | Enable or disable dragging the progress indicator on task bars. Set to false when progress is calculated automatically. |
gantt.config.show_progress_colors | Boolean | true | Enable dynamic progress-based coloring (red, orange, blue, gray). Set to false for fully static coloring via task.color. |
Display Properties
| Property | Type | Default | Description |
|---|---|---|---|
gantt.config.workingHoursPerDay | Integer | 8 | Default working hours per day for all resources. Overrides the server-side administration property for this widget instance. |
Custom Working Hours Function
Define per-resource working hours:Template Functions (gantt.templates)
Override rendering templates to customize how task elements display:Right-Side Text
Display custom text to the right of each task bar:Right-Side Text with Status Icon
Status Icon Only
Template functions access data prepared by the Item Script via
task.fields.*. Prepare your data in the Item Script using task.getFields().put(KEY, VALUE), then reference it in templates as task.fields.KEY.Common Configuration Patterns
Disable Dependency Link Creation
Disable Progress Dragging
Enable Static Coloring
Disable dynamic progress-based colors to use onlytask.color values set in the Item Script:
Combined Example
REST API Endpoints
The Gantt chart communicates with the server via these REST API endpoints:| Endpoint | Method | Description |
|---|---|---|
gantt/api/data | GET | Serves Gantt data (tasks, links, resources). Requires config query parameter. |
gantt/api/conf | GET | Serves Gantt configuration data. |
gantt/api/fields | GET | Returns custom field metadata for the lightbox form. |
api/clearCalendarCache | GET | Clears the server-side working calendar cache. Call after modifying calendar work items when caching is enabled. |
Error Handling
- Script errors display as a warning indicator with a count badge in the Gantt toolbar
- Config Script Error: prefix identifies errors from this script
- Markers Script Error: prefix identifies errors from the markers script
- Item Script Error: prefix identifies errors from the Item Script
- Errors appear in both view mode and wiki editor mode with different messages
Configuration Example
A complete Gantt Config Script for a project tracking view:Related Pages
- Item Script API — server-side script for data preparation
- Velocity Context Variables — server-side variables for dynamic script generation
- Item Color Legend — how
show_progress_colorsaffects task colors - Default Configuration Values — server-level property defaults
- Dependency Types Reference — advanced dependency link types
Sources
Sources
KB ArticlesSupport TicketsSource Code
prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/scripts.jsprod-gantt-src/com.nextedy.polarion.gantt.client/src/js/config.jsprod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/widget/PlansGanttWidget.javaprod-gantt-src/com.nextedy.polarion.gantt.client/src/js/nextedy.jsprod-gantt-src/com.nextedy.polarion.gantt.client/src/js/default.json