Skip to main content

Prerequisites

  • A Gantt widget added to a Polarion LiveDoc or Wiki page
  • Access to the widget parameter editor (Edit mode on the page)

Open the Config Script Editor

  1. Open the page containing your Gantt widget in edit mode.
  2. In the widget parameters panel, locate the Advanced section.
  3. Find the Gantt Config Script parameter and click to expand the script editor.
This script runs once during chart initialization. Any gantt.config.* properties you set here override system defaults and administration-level Configuration Properties for this specific widget instance.

Understand the Script Scope

The Gantt Config Script executes with access to these objects:
ObjectPurpose
ganttThe chart instance with gantt.config, gantt.templates, and event handlers
configThe Nextedy configuration object with widget parameters and context
NextedyThe Nextedy singleton exposing markers, editors, and license info
diagram Configuration Properties set system-wide defaults. Widget parameters override those defaults per instance. The Gantt Config Script runs last and can override both.

Common Configuration Patterns

Disable Progress Drag

Prevent users from adjusting progress by dragging the task bar fill:
gantt.config.drag_progress = false;

Set Custom Resolved Color

Override the default color for resolved work items while keeping progress-related coloring active:
gantt.config.progress_color_resolved = "#0AA33A";
You can also set this globally via the Configuration Property nextedy.gantt.default.progress_color_resolved.

Enable Square Task Borders

Switch from rounded to square task bar borders:
gantt.config.squareTaskBorder = true;
Set nextedy.gantt.config.squareTaskBorder=true in Administration > Configuration Properties to apply square borders globally. Use gantt.config.squareTaskBorder = false in the Gantt Config Script to override the global setting for a specific chart.

Customize Right-Side Text

Display a custom label to the right of each task bar using the rightside_text template:
gantt.templates.rightside_text = function(start, end, task) {
    return task.progressString || "";
};

Disable Auto-Scheduling

Turn off automatic date propagation for this chart instance:
gantt.config.auto_scheduling = false;
The system default is controlled by nextedy.gantt.default.auto_scheduling (default: false).

Configuration Properties Reference

These nextedy.gantt.* properties can be set in Administration > Configuration Properties as system-wide defaults:
PropertyDefaultPurpose
nextedy.gantt.default.auto_schedulingfalseEnable auto-scheduling
nextedy.gantt.default.critical_pathfalseShow critical path
nextedy.gantt.config.squareTaskBorderfalseSquare task borders
nextedy.gantt.workitems.unplanned_color#7D3C98Unplanned item color
nextedy.gantt.today.colorgrayToday marker color
nextedy.gantt.debugfalseEnable debug messages
The Gantt Config Script runs during chart initialization. If you modify gantt.config properties after the chart renders, call gantt.render() to apply changes. Template functions (like rightside_text) take effect on the next render cycle automatically.

Handle Script Errors

When the Gantt Config Script contains a syntax or runtime error, the chart displays a warning indicator in the footer. In edit mode, clicking the indicator shows the error details prefixed with Config Script Error:. In view mode, a triangle icon appears as a warning. Check the browser console for detailed error messages. See Debug Script Errors for a systematic debugging approach.

Verify Your Changes

After saving the page, reload the Gantt chart. You should now see your configuration changes reflected:
  • Modified task bar styles or colors appear immediately
  • Template changes (right-side text, tooltips) render with each task bar
  • Disabled features (drag progress, auto-scheduling) no longer respond to user interaction

See Also

KB ArticlesSupport TicketsSource Code
  • prod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/widget/PlansGanttWidget.java
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/scripts.js
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/config.js
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/nextedy.js
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/default.json