Gantt.
PROArrange task durations and progress on a timeline.
LIVE EXAMPLE
Project schedule
Appearance and style6
Legend and interaction13
Title and dimensions3
Task durations, progress, and milestones. All values are sample data.
View code
<div id="chart-container" style="width: 100%; min-width: 0;"></div>
<script type="module">
import { defineCustomElement as define0 } from '@syidax/advanced-pro/components/sy-gantt-chart.js';
define0();
// Pro: complete registerLicense at app startup using your issued certificate.
// The website preview certificate is not for use in customer apps.
const specs = [
{
"id": "example-chart",
"tag": "sy-gantt-chart",
"props": {
"data": [
{
"id": "research",
"label": "Research",
"start": "2026-01-05",
"end": "2026-01-09",
"progress": 1,
"color": "#8263d9"
},
{
"id": "design",
"label": "Design",
"start": "2026-01-08",
"end": "2026-01-16",
"progress": 0.65,
"color": "#239c91"
},
{
"id": "build",
"label": "Implementation",
"start": "2026-01-14",
"end": "2026-01-26",
"progress": 0.3,
"color": "#e99954"
},
{
"id": "launch",
"label": "Release",
"start": "2026-01-28",
"milestone": true
}
],
"width": 640,
"height": 360,
"brandPosition": "bottom-right",
"brandLogo": ""
}
}
];
const container = document.querySelector('#chart-container');
const elements = specs.map(({ tag, id, props }) => {
const element = document.createElement(tag);
element.id = id;
Object.assign(element, props);
element.setAttribute('aria-label', 'gantt example chart');
return element;
});
container.replaceChildren(...elements);
const chart = elements.at(-1);
const onEvent = event => {
console.log('taskClick', event.detail);
};
chart.addEventListener('taskClick', onEvent);
const observer = new ResizeObserver(([entry]) => {
const width = Math.max(160, Math.floor(entry.contentRect.width));
elements.forEach(element => { element.width = width; });
});
observer.observe(container);
// In an SPA, call this function when the view is disposed.
function disposeChart() {
observer.disconnect();
chart.removeEventListener('taskClick', onEvent);
container.replaceChildren();
}
</script>Usage and data
#Manage project schedules, milestones, and baselines together.
This display example does not save tasks. Connect application persistence to editing events to save changes.
Data contract
| Property | Input format |
|---|---|
data | An array of tasks as { id, label, start, end?, progress?, milestone?, baseline? }. progress ranges from 0 to 1. |
Updating data
Assign a new array or object to the property instead of mutating values inside an array. Chart events provide selection results through event.detail. When disposing of the view, clean up ResizeObserver and event listeners registered by your app.
Feature examples
#Try 36 interactive feature examples and inspect their code. Select “Edit in preview” to combine more options in the settings panel above.
Show task progressPRO
Display the completion percentage inside each task bar.
View code
Row spacingPRO
Compare schedules with reduced task heights and row spacing.
View code
Inspect values with the pointerPRO
Point to data to view the value at that location.
View code
Crosshair trackingPRO
Move the pointer to read horizontal and vertical coordinates alongside values.
View code
Drag to zoom and panPRO
Drag to zoom and hold Shift to pan. Use Ctrl + wheel to zoom in or out.
View code
Replay animationPRO
Redraw the same example to inspect its initial display animation.
View code
AccessibilityPRO
Compare 4 examples of Accessibility. Buttons and options update both the live result and source code.
View code
AnimationPRO
Compare 3 examples of Animation. Buttons and options update both the live result and source code.
View code
BaselinePRO
Compare 3 examples of Baseline. Buttons and options update both the live result and source code.
View code
ColorPRO
Compare 3 examples of Color. Buttons and options update both the live result and source code.
View code
Critical PathPRO
Compare 3 examples of Critical Path. Buttons and options update both the live result and source code.
View code
CrosshairPRO
Compare 3 examples of Crosshair. Buttons and options update both the live result and source code.
View code
Data inputPRO
Compare 2 examples of Data input. Buttons and options update both the live result and source code.
View code
DependenciesPRO
Compare 3 examples of Dependencies. Buttons and options update both the live result and source code.
View code
LabelPRO
Compare 3 examples of Label. Buttons and options update both the live result and source code.
View code
Large datasetsPRO
Compare 2 examples of Large datasets. Buttons and options update both the live result and source code.
View code
SizePRO
Compare 1 examples of Size. Buttons and options update both the live result and source code.
View code
Task barsPRO
Compare 4 examples of Task bars. Buttons and options update both the live result and source code.
View code
Task EditingPRO
Compare 3 examples of Task Editing. Buttons and options update both the live result and source code.
View code
Time AxisPRO
Compare 4 examples of Time Axis. Buttons and options update both the live result and source code.
View code
TooltipPRO
Compare 14 examples of Tooltip. Buttons and options update both the live result and source code.
View code
Zoom and panPRO
Compare 3 examples of Zoom and pan. Buttons and options update both the live result and source code.
View code
Context menuPRO
Compare 1 examples of Context menu. Buttons and options update both the live result and source code.
View code
DependenciesPRO
Compare 1 examples of Dependencies. Buttons and options update both the live result and source code.
View code
HoverPRO
Compare 1 examples of Hover. Buttons and options update both the live result and source code.
View code
Data context menuPRO
Compare 1 examples of Data context menu. Buttons and options update both the live result and source code.
View code
RuntimePRO
Compare 1 examples of Runtime. Buttons and options update both the live result and source code.
View code
Selection ChangedPRO
Compare 1 examples of Selection Changed. Buttons and options update both the live result and source code.
View code
Task ClickPRO
Compare 1 examples of Task Click. Buttons and options update both the live result and source code.
View code
Task EditPRO
Compare 1 examples of Task Edit. Buttons and options update both the live result and source code.
View code
ExportPRO
Compare 1 examples of Export. Buttons and options update both the live result and source code.
View code
Read coordinates and dataPRO
Compare 2 examples of Read coordinates and data. Buttons and options update both the live result and source code.
View code
Runtime APIPRO
Compare 1 examples of Runtime API. Buttons and options update both the live result and source code.
View code
OptionalPRO
Compare 1 examples of Optional. Buttons and options update both the live result and source code.
View code
OverviewPRO
Compare 4 examples of Overview. Buttons and options update both the live result and source code.
View code
Streaming · Add and update live dataPRO
Compare 5 examples of Add and update live data. Buttons and options update both the live result and source code.
View code
Add to your interface
#The code tabs below the preview contain the full data, options, event bindings, and responsive sizing for the current example. Copy them into an app project, such as Vite, that can resolve the installed packages.
API reference
#The full public API for sy-gantt-chart. Pass objects and arrays as JavaScript properties. Select a name to view usage code and type definitions.
Key properties
| Attribute / Property | Type / Default | Description |
|---|---|---|
GanttDataDefault: undefined | An array of tasks as { id, label, start, end?, progress?, milestone?, baseline? }. progress ranges from 0 to 1. | |
numberDefault: 900 | Chart width in pixels. Update with ResizeObserver when the container changes. | |
numberDefault: 400 | Chart height in pixels. | |
| brandLogo | stringDefault: undefined | The default is the Syidax logo. With the Pro chart.branding entitlement, use none or a PNG, JPEG, or WebP data URL. |
| brandPosition | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'Default: 'bottom-right' | The corner where the logo is anchored. Applies equally to Community and Pro, on screen and in image exports. |
| barHeight | numberDefault: 24 | Maximum task bar height and gap in CSS pixels. |
| rowGap | numberDefault: 4 | Set as an HTML attribute or JavaScript property. type: number. |
| barRadius | numberDefault: 3 | Set as an HTML attribute or JavaScript property. type: number. |
| progressShow | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
| progressColor | stringDefault: 'auto' | Set as an HTML attribute or JavaScript property. type: string. |
CartesianCrosshairInputDefault: undefined | Pass as a JavaScript property. type: CartesianCrosshairInput. | |
| taskLabels | GanttLabelModeDefault: 'auto' | Allowed values: auto, show, hide. Default: 'auto'. |
| chartTitle | stringDefault: undefined | The title inside the chart. Explain the data's unit and meaning alongside it. |
| chartSubtitle | stringDefault: undefined | The subtitle inside the chart. |
CartesianTooltipInputDefault: undefined | Tooltip settings for pointer-driven values, position, and content. | |
| tooltipEnabled | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
| animated | booleanDefault: false | Whether to animate initial display and data changes. |
| animationDuration | numberDefault: 600 | Animation duration in milliseconds. |
| animationEasing | GanttEasingDefault: 'ease-out' | Allowed values: linear, ease-out, ease-in, ease-in-out. Default: 'ease-out'. |
| animationType | GanttAnimationTypeDefault: undefined | Allowed values: initial, update. Default: undefined. |
CartesianZoomInputDefault: undefined | Settings for zooming and the visible range. |
Other properties 18
| Attribute / Property | Type / Default | Description |
|---|---|---|
| taskLabelFormat | (task:GanttTask)=>stringDefault: undefined | Pass as a JavaScript property. type: (task:GanttTask)=>string. |
| timeDomain | readonly [number, number]Default: undefined | Optional full timeline extent in epoch milliseconds. |
| criticalPath | GanttCriticalPathInputDefault: undefined | Pass as a JavaScript property. type: GanttCriticalPathInput. |
| taskEditing | GanttTaskEditingInputDefault: undefined | Opt-in task move/resize. Committed local edits are queried through getTasks/getTaskEdits; source updates supersede them. |
GanttBaselineStyleInputDefault: undefined | Reference-date strips, visible by default when tasks include baseline dates. | |
ReadonlyArray<GanttDependencyInput>Default: undefined | Pass as a JavaScript property. type: ReadonlyArray<GanttDependencyInput>. | |
| dependencyStyle | GanttDependencyStyleInputDefault: undefined | Pass as a JavaScript property. type: GanttDependencyStyleInput. |
| timeAxis | GanttTimeAxisInputDefault: undefined | Pass as a JavaScript property. type: GanttTimeAxisInput. |
| crosshairTimeUnit | GanttCrosshairTimeUnitDefault: 'hour' | Crosshair time badge precision; hour by default. Uses timeAxis.utc without changing event timestamps. |
stringDefault: 'auto' | Set as an HTML attribute or JavaScript property. type: string. | |
| activeColor | stringDefault: '#f59e0b' | Set as an HTML attribute or JavaScript property. type: string. |
| enableMouseTracking | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
| tooltipFormat | (detail: GanttHitDetail) => stringDefault: undefined | Pass as a JavaScript property. type: (detail: GanttHitDetail) => string. |
| streamSource | GanttStreamSourceDefault: undefined | A stream source for live data. Check the contract for the specific type. |
| streamMax | numberDefault: undefined | The maximum number of streaming data points to retain. |
| streamWindow | numberDefault: undefined | The streaming data range to keep visible. |
GanttEngineModeDefault: 'auto' | Renderer selection: auto, standard, or pro. Engine selection is separate from permission to use a Pro chart type. | |
GanttUnavailableBehaviourDefault: 'fallback' | Allowed values: fallback, error. Default: 'fallback'. |
Events 22
| Events | Detail type | Description |
|---|---|---|
GanttRenderResult & { tier: GanttEngineTier } | Emits rendering results in detail when chart drawing completes. | |
GanttDependencyHitDetail | CustomEvent.detail type: GanttDependencyHitDetail. Event names are case-sensitive. | |
GanttDependencyHitDetail | null | CustomEvent.detail type: GanttDependencyHitDetail | null. Event names are case-sensitive. | |
GanttDependencySelectionChange | CustomEvent.detail type: GanttDependencySelectionChange. Event names are case-sensitive. | |
GanttHitDetail | CustomEvent.detail type: GanttHitDetail. Event names are case-sensitive. | |
GanttHitDetail | null | CustomEvent.detail type: GanttHitDetail | null. Event names are case-sensitive. | |
GanttTaskEditEventDetail | CustomEvent.detail type: GanttTaskEditEventDetail. Event names are case-sensitive. | |
GanttTaskEditEventDetail | CustomEvent.detail type: GanttTaskEditEventDetail. Event names are case-sensitive. | |
GanttTaskEditEventDetail | Cancelable before local dates, completion and row order commit. preventDefault restores the prior state. | |
GanttTaskEditEventDetail | CustomEvent.detail type: GanttTaskEditEventDetail. Event names are case-sensitive. | |
GanttSelectionChangeEventDetail | CustomEvent.detail type: GanttSelectionChangeEventDetail. Event names are case-sensitive. | |
ChartPointContextMenuEventDetail<GanttHitDetail> | CustomEvent.detail type: ChartPointContextMenuEventDetail<GanttHitDetail>. Event names are case-sensitive. | |
{ count: number; replaced: number } | CustomEvent.detail type: { count: number; replaced: number }. Event names are case-sensitive. | |
{ dropped: number } | CustomEvent.detail type: { dropped: number }. Event names are case-sensitive. | |
CartesianTooltipEventDetail | Whether to display the built-in tooltip. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
CartesianTooltipActionEventDetail | CustomEvent.detail type: CartesianTooltipActionEventDetail. Event names are case-sensitive. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
CartesianZoomChangeEventDetail | CustomEvent.detail type: CartesianZoomChangeEventDetail. Event names are case-sensitive. | |
CartesianCrosshairEventDetail | null | CustomEvent.detail type: CartesianCrosshairEventDetail | null. Event names are case-sensitive. |
Methods 50
Stencil methods return Promises. Use await within an async function to read the result.
| Method / Arguments | Return type | Description |
|---|---|---|
Promise<GanttCriticalPathResult> | An asynchronous method. Check the argument and return types below. | |
Promise<GanttDependencyDataset> | An asynchronous method. Check the argument and return types below. | |
Promise<GanttDependencyPath[]> | An asynchronous method. Check the argument and return types below. | |
| cssX: number, cssY: number | Promise<GanttDependencyHitDetail|null> | An asynchronous method. Check the argument and return types below. |
Promise<GanttDependencySelection> | An asynchronous method. Check the argument and return types below. | |
| index: number | Promise<GanttDependencyHitDetail|null> | An asynchronous method. Check the argument and return types below. |
| index: number | Promise<CartesianTooltipEventDetail|null> | An asynchronous method. Check the argument and return types below. |
Promise<GanttRenderResult> | An asynchronous method. Check the argument and return types below. | |
Promise<ChartEngineStatus> | Requested engine vs what runs, and why (CHART-ADD-08); a frozen or unlicensed chart reports the license outcome. | |
Promise<GanttEngineTier> | An asynchronous method. Check the argument and return types below. | |
Promise<string | undefined> | An asynchronous method. Check the argument and return types below. | |
| data: GanttData | Promise<void> | An asynchronous method. Check the argument and return types below. |
Promise<GanttTask[]> | An asynchronous method. Check the argument and return types below. | |
| index: number | Promise<GanttTask | null> | An asynchronous method. Check the argument and return types below. |
| id: string | Promise<GanttTask | null> | An asynchronous method. Check the argument and return types below. |
Promise<GanttDiagnostics> | Normalization diagnostics for the effective base and stream source. | |
Promise<number> | An asynchronous method. Check the argument and return types below. | |
Promise<GanttExtent> | An asynchronous method. Check the argument and return types below. | |
Promise<GanttLayoutResult> | An asynchronous method. Check the argument and return types below. | |
Promise<GanttBaselineComparison[]> | Reference comparisons for every accepted task, including hidden/offscreen baselines. Positive variance means later or longer. | |
| task: GanttTaskInput | Promise<void> | An asynchronous method. Check the argument and return types below. |
| tasks: ReadonlyArray<GanttTaskInput> | Promise<void> | An asynchronous method. Check the argument and return types below. |
| count: number | Promise<void> | An asynchronous method. Check the argument and return types below. |
| tasks: ReadonlyArray<GanttTaskInput> | Promise<void> | An asynchronous method. Check the argument and return types below. |
Promise<GanttStreamSource | undefined> | An asynchronous method. Check the argument and return types below. | |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
| options: { enabled?: boolean; duration?: number; easing?: GanttEasing; type?: GanttAnimationType } | Promise<void> | An asynchronous method. Check the argument and return types below. |
| cssX: number, cssY: number | Promise<GanttHitDetail | null> | An asynchronous method. Check the argument and return types below. |
| index: number | Promise<GanttHitDetail | null> | An asynchronous method. Check the argument and return types below. |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
Promise<GanttSelection> | An asynchronous method. Check the argument and return types below. | |
| index: number | Promise<CartesianTooltipEventDetail | null> | An asynchronous method. Check the argument and return types below. |
| index: number | Promise<CartesianTooltipEventDetail | null> | An asynchronous method. Check the argument and return types below. |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
Promise<GanttTaskEdit[]> | Committed local dates, completion and displaced rows; never mutates caller data. | |
| id?: string | Promise<void> | An asynchronous method. Check the argument and return types below. |
Promise<boolean> | An asynchronous method. Check the argument and return types below. | |
| request: CartesianZoomRequest | Promise<CartesianZoomChangeEventDetail | null> | Zoom to an explicit millisecond x window. Task rows do not accept y zoom requests. |
| factor: number, anchorFraction?: number | Promise<CartesianZoomChangeEventDetail | null> | Scale the current windows by `factor` (< 1 zooms in) around `anchorFraction` (0..1, default centre). |
| delta: { x?: number; y?: number } | Promise<CartesianZoomChangeEventDetail | null> | Slide the zoomed windows by milliseconds (`{ x?, y? }`); a no-op at the full extent. |
Promise<CartesianZoomChangeEventDetail | null> | Back to the full diagram. | |
Promise<CartesianZoomState | null> | The current zoom state (`null` = the full diagram). | |
| request?: CartesianZoomExtentRequest | Promise<CartesianZoomExtentDetail | null> | The full timestamp extent and axis key (`null` before the first layout). |
Promise<ChartDataTable> | An asynchronous method. Check the argument and return types below. | |
Promise<GanttLabel[]> | An asynchronous method. Check the argument and return types below. | |
Promise<GanttTimeAxisModel> | An asynchronous method. Check the argument and return types below. | |
| request: CartesianCrosshairShowRequest | Promise<boolean> | Quiet sync API: epoch milliseconds and a zero-based task row; no crosshairMove feedback loop. |
Promise<void> | An asynchronous method. Check the argument and return types below. |
No matching APIs.