Access the Markers Script
Markers are defined in the Markers Script, located under Widget Properties > Advanced > Markers Script. This server-side script runs each time the Gantt loads and produces the set of marker lines displayed on the timeline. The script has access to themarkerFactory object, which provides methods for creating markers manually and from Polarion data.
Add a Marker Manually
To create a single marker at a specific date, use themarkerFactory.addMarker() method:
| Method | Description |
|---|---|
setText(String text) | Set the marker label displayed on the timeline |
setTitle(String tooltip) | Set the tooltip text shown on hover |
setDate(String dateStr) | Set the marker date (format: "YYYY-MM-DD") |
setDate(java.util.Date date) | Set the marker date from a Java Date object |
setColor(String color) | Set the marker color (one of the 16 basic HTML color names) |
Add Markers from Plans
UseaddPlanMarkers to automatically create markers from Polarion Plan items matching a Lucene query:
Add Markers from Work Items
UseaddWorkItemMarkers to create markers from work items, specifying which date field to use:
| Parameter | Description |
|---|---|
| First argument | Lucene query filtering which work items to include |
| Second argument | The date field to read the marker date from (e.g., "start", "publicLaunch") |
| Third argument | Marker color |
Use the Polarion API for Dynamic Markers
For full scripting control, use thetrackerService API to query Polarion data and build markers dynamically. This approach supports conditional logic, custom tooltips, and color-coding based on field values.
Example: Load Time Points as markers:
milestone page parameter, queries them, and renders each as a marker. Changing the page parameter updates which markers appear without editing the script.
Marker CSS Classes
Markers receive CSS classes based on their type, which you can use for custom styling:| CSS Class | Applied To |
|---|---|
today | The automatic today-date marker |
plan | Markers created from Plan items via addPlanMarkers |
gantt_marker | All custom markers (base class) |
Marker Tooltips
Hovering over a marker line displays a tooltip showing the marker name and date. Set the tooltip content usingmarker.setTitle() for custom tooltip text, or let the Gantt generate a default tooltip from the marker text and date.
Verification
You should now see vertical marker lines on the Gantt timeline at the configured dates. Hover over each marker to verify the tooltip displays the expected name and date. If markers do not appear, check the Markers Script for errors using the warning indicator in the Gantt toolbar area.See also
- Configure Milestone Work Items
- Create Markers with Scripts
- Configure Page Parameters
- Customize Gantt Tooltips
- Show Deadlines and Due Dates
Sources
Sources
KB ArticlesSupport TicketsSource Code
prod-gantt-src/com.nextedy.polarion.gantt.client/cypress/e2e/ganttCheckWarningInfo.cy.tsprod-gantt-src/com.nextedy.polarion.gantt.client/src/js/tooltips.jsprod-gantt-src/com.nextedy.polarion.gantt.client/cypress/e2e/Aresource-view/ganttMarkersColorConfigValidation.cy.tsprod-gantt-src/com.nextedy.polarion.gantt.client/cypress/e2e/milestones/marker-colors.cy.tsprod-gantt-src/com.nextedy.polarion.gantt.client/cypress/e2e/view/markersStyles.cy.ts