Where to Add Marker Scripts
Open your Gantt widget parameters, expand the Advanced section, and locate the Markers Script field. All marker scripts go here. The script has access tomarkerFactory, trackerService, and config objects.
Marker Factory API
ThemarkerFactory object provides these methods:
| Method | Purpose |
|---|---|
markerFactory.addMarker() | Create a new empty marker object |
markerFactory.addMarker(text, date) | Create a marker with text and date string |
markerFactory.addPlanMarkers(query, color) | Add markers from Polarion plans matching a Lucene query |
markerFactory.addWorkItemMarkers(query, dateField, color) | Add markers from work items matching a Lucene query |
addMarker() has these setter methods:
| Method | Purpose |
|---|---|
marker.setText(String) | Set the marker label |
marker.setTitle(String) | Set the tooltip text |
marker.setDate(Date) | Set the date (java.util.Date) |
marker.setDate(String) | Set the date as string ("2025-08-04" format) |
marker.setColor(String) | Set the color (one of the 16 basic HTML colors) |
Add a Manual Marker
Create a fixed marker at a specific date:Add Markers from Plans
Automatically generate markers from Polarion plan boundaries (iterations, sprints):config.getContextProjectId() instead of a hardcoded project ID:
Add Markers from Work Items
Generate markers from work items of a specific type using a date field:"publicLaunch") specifies which date field on the work item provides the marker date.
Use Polarion API for Dynamic Markers
For full scripting control, usetrackerService to query work items and create markers programmatically. This example loads Polarion project time points:
Filter Markers with Page Parameters
Use page parameters to let users control which markers appear. This example reads amilestone page parameter and renders matching work items as markers:
Marker Styling
Markers automatically receive CSS classes based on their source:| Marker Type | CSS Class | Default Appearance |
|---|---|---|
| Today marker | today | Highlighted vertical line |
| Plan markers | plan | Styled as plan boundary lines |
| Custom markers | gantt_marker + color class | Default styling with optional color |
Handle Script Errors
If the Markers Script contains errors, the Gantt chart displays a warning indicator in the footer with the prefix Markers Script Error:. Check the browser console for details. See Debug Script Errors for systematic debugging.Verify Your Changes
Save the page and reload the Gantt chart. You should now see vertical marker lines on the timeline at the specified dates, with labels and colors matching your script configuration. Hover over markers to confirm tooltip text displays correctly.See Also
- Create and Configure Markers for marker visualization options
- Write Page Scripts with Velocity for server-side Velocity scripting
- Configure Page Parameters for dynamic parameter-based filtering
- Debug Script Errors for troubleshooting marker script issues
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/src/com/nextedy/polarion/gantt/model/MarkerFactory.javaprod-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/cypress/e2e/view/markersStyles.cy.ts