Understand Static vs. Dynamic Coloring
Before writing color scripts, choose between two coloring modes:
Default Color Legend
Out of the box, the Gantt chart uses these dynamic colors:
Case 1: Date-Based Dynamic Coloring
Highlight tasks starting after today in green while keeping progress colors for all other tasks.
In Widget Parameters > Advanced > Item Script:
This uses dynamic coloring (task.taskColor), so overdue and delayed tasks retain their red/orange indicators.
Case 2: Type and Status Static Coloring
Color tasks based on their work item type and status, overriding all automatic colors.
In Widget Parameters > Advanced > Gantt Config Script:
In Widget Parameters > Advanced > Item Script:
If you set task.taskColor for tasks that already changed color due to progress (overdue, delayed), the dynamic color takes precedence. Switch to task.color with show_progress_colors = false for full control.
Case 3: Assignee-Based Coloring
Color tasks by their assigned user. This example uses dynamic coloring for a single-assignee scenario:
Both task.color and task.taskColor accept standard color names and HEX values like "#bfbfbf". Use HEX for precise brand or team colors.
Case 4: Overdue Highlighting Without Progress Colors
Show tasks with end dates in the past as red, with all other progress coloring disabled:
In Gantt Config Script:
In Item Script:
If your scripts use wi.type.id or wi.status.id, update them to wi.getType().getId() and wi.getStatus().getId() after upgrading to Polarion 2304+. See Migrate Scripts for Polarion 2304+.
Verify Your Changes
Save the page and reload the Gantt chart. You should now see task bars reflecting your custom color logic. Hover over individual tasks to confirm that the correct conditions trigger the expected colors.
See Also