Options
Configuration Structure
Options: {}theme
'light'Color theme preset.
Available Options:
- light (default)
- dark
width
'100%'Width of the chart. Accepts a pixel number or a CSS string.
height
'500px'Height of the chart. Accepts a pixel number or a CSS string.
canvasStyle
'border: 1px solid #CACED0; box-sizing: border-box'Arbitrary CSS injected onto the root container element.
pixelsPerDay
Initial zoom level expressed as pixels per day. Continuous — the timeline header automatically picks calendar tiers (year, quarter, month, week, day, halfday, hour, minute) based on the current value. Bounds are clamped to roughly [0.25, 1280] px/day.
Reference values calibrated against the legacy presets:
- Year ≈
0.5 - Quarter ≈
1.6 - Month ≈
4.9 - Week ≈
25.7 - Day =
80
When omitted, the chart auto-fits the full data range into the visible timeline area on first render. Supply an explicit value (or use the toolbar zoom controls) to take control.
backgroundColor
'#FFFFFF'Background color of the whole chart container.
headerBackground
'#EBF3FB'Background color of the timeline and task-list header row.
borderColor
'#DFE0E1'Color of the cell and row divider lines.
cellBorderColor
'#D0D7DE'Border color for all cells in the task table and timeline grid.
cellBorderWidth
'1px'CSS border-width for all cell lines.
columnLines
trueWhether to draw vertical lines between timeline columns. Set to false for a cleaner aesthetic that keeps only the horizontal row dividers.
Available Options:
- true (default)
- false
inputDateFormat
'MM-DD-YYYY'dayjs-compatible format string used to parse startTime / endTime values. Include time tokens (e.g. 'YYYY-MM-DD HH:mm') to enable sub-day scheduling; end-times are then treated as exclusive timestamps and inline editors switch to datetime-local inputs.
tasksContainerWidth
425Initial pixel width of the task-list panel.
enableResize
trueAllow the task-list panel to be resized by dragging the divider.
enableExport
trueShow the SVG export button in the toolbar.
arrowColor
'#94A3B8'Color of dependency arrows between tasks.
barBackgroundColor
'#87B7FE'Default background fill color for task bars. Theme-aware: a different default applies in the dark theme.
barBorderRadius
'5px'CSS border-radius applied to task bars.
barMargin
8Top and bottom margin inside each row for the task bar in pixels.
barTextColor
'#FFFFFF'Text color rendered inside task bars.
summaryBarColor
'#B9CECE'Fill color for summary (group) bars. Renders distinct from regular task bars to make the parent/child hierarchy visually obvious. Theme-aware.
milestoneColor
'#7C3AED'Fill color for milestone diamonds. Theme-aware.
barLabel
Per-task bar label. By default the task name renders to the right of the bar so narrow bars don't clip their text. Set position: 'inside' to render centered inside the bar, 'auto' to pick automatically based on bar width, or supply render to compose names with chips, icons, or owner info.
barLabel: {
position: 'auto',
render: (task) => `<span>${task.name} · ${task.progress}%</span>`,
}
position
'right'Where to render the label relative to the bar.
Available Options:
- right (default) — rendered immediately to the right of the bar; always visible regardless of bar width
- inside — centered inside the bar; clipped when the bar is narrower than the text
- left — rendered immediately to the left of the bar
- auto —
insidewhen the label fits, otherwiseright
field
'name'Task field whose value populates the label when render is not set.
render
Custom renderer for the bar label. Receives the resolved task and returns an HTML string (assigned via innerHTML — escape user input yourself) or an HTMLElement. Returning null or undefined falls back to rendering barLabel.field.
className
Extra CSS class added to the label element.
leadingPadding
0Pixels of empty space added to the start of the timeline so left-side labels have room to render without being hidden behind the task-list panel. Auto-defaults to 120 when position is 'left', and 0 otherwise. Set explicitly to 0 to disable the padding.
rowBackgroundColors
['#FFFFFF']Alternating row background colors. The pattern cycles automatically.
rowHeight
38Height of each task row in pixels.
enableTaskDrag
trueAllow tasks to be reordered by dragging rows in the task list.
enableTaskEdit
falseShow the inline task-edit form when a task row is clicked.
enableInlineEdit
falseAllow editing task fields directly in task-list cells. When true, double-clicking a name, startTime, endTime, duration, or progress cell swaps the cell for an input — commit with Enter or blur, cancel with Escape. Summary rows, milestones, and empty rows are not editable. Auto-enabled when enableTaskEdit is true unless explicitly set to false.
Available Options:
- false (default)
- true
enableTaskResize
trueAllow task bars to be resized by dragging their handles.
enableProgressDrag
trueAllow editing task progress by dragging the small handle at the bottom of the bar. The handle becomes visible on bar hover and snaps to whole percent on commit. Emits a taskProgressChanged event.
Available Options:
- true (default)
- false
snapUnit
'day'Granularity at which task drag, resize, and inline edits snap. Affects data updates only — the timeline header tier follows pixelsPerDay independently. Use 'hour' or 'minute' together with snapValue for sub-day scheduling; end-times are treated as exclusive timestamps when inputDateFormat includes time tokens.
Available Options:
- day (default)
- hour
- minute
snapValue
1Multiplier applied to snapUnit. Examples: snapUnit: 'minute', snapValue: 15 snaps to 15-minute increments; snapUnit: 'hour', snapValue: 6 snaps to 6-hour increments.
enableSelection
falseEnable row selection (click, Ctrl+Click, Shift+Click, keyboard).
showCheckboxColumn
trueShow a checkbox column for multi-select. Only applies when enableSelection is true.
enableCriticalPath
falseWhen true, calculates and highlights the critical path through dependent tasks.
criticalBarColor
'#e53935'Fill color for task bars on the critical path (requires enableCriticalPath: true).
criticalArrowColor
'#e53935'Stroke color for dependency arrows on the critical path.
enableRollups
falseWhen true, summary (parent) rows display thin rollup markers below the summary bar at each leaf descendant's date range — a glance-able overview of children that stays visible even when the parent is collapsed.
Available Options:
- false (default)
- true
baseline
Baseline options. When enabled is true, tasks with a baseline field render a thin bar below the actual bar to show schedule variance.
enabled
falseWhether to render baseline bars below actual bars.
color
'#BBD5DA'Color of the baseline bar.
dependencies
Visual and interaction options for dependency arrows. Tune cornerRadius for tighter or looser joints, set hitWidth to add an invisible thicker target zone for hover/click on thin strokes, and use tooltipTemplate / classBuilder for per-arrow content and styling.
dependencies: {
cornerRadius: 6,
hitWidth: 12,
classBuilder: (ctx) => ctx.fromTask.team !== ctx.toTask.team ? 'cross-team' : '',
tooltipTemplate: (ctx) => `<b>${ctx.fromTask.name}</b> → <b>${ctx.toTask.name}</b>`,
}
cornerRadius
4Pixel radius for rounded joints on dependency arrows. 0 produces sharp 90° corners; larger values produce smoother arcs (clamped per-corner to half the shorter adjacent segment so an arc never overshoots).
hitWidth
0Invisible hit-area thickness in pixels. When greater than 0, each arrow renders an additional transparent path of this width that captures pointer events, making the thin visible stroke easier to hover or click. Required for tooltipTemplate to fire.
classBuilder
Returns CSS class name(s) for each arrow. Receives a DependencyContext (fromTask, toTask, type, lag) and returns a class name string, an array of class names, or undefined. Use to tag arrows by relationship — cross-team, blocked, optional — and style them via custom CSS.
tooltipTemplate
Returns an HTML string shown when the user hovers an arrow. Receives a DependencyContext (fromTask, toTask, type, lag). Requires a non-zero hitWidth so the hover hit area is large enough to register reliably.
enableCrosshair
falseShow a vertical crosshair line that follows the cursor across the timeline, with a label displaying the precise date or time at the pointer position.
Available Options:
- false (default)
- true
crosshairColor
'#87B7FE'Color of the crosshair line and label background. Theme-aware.
crosshairLabelFormat
Custom formatter for the crosshair label text. Receives the date under the cursor and the current sub-tier of the timeline header ('minute' | 'hour' | 'halfday' | 'day' | 'week' | 'month' | 'quarter' | 'year'). When omitted, the label auto-adapts to the active tier — coarse formats for week-and-above, HH:mm for halfday, hour, or minute tiers.
crosshairLabelFormat(date, tier) {
return `${tier}: ${date.toISOString()}`;
}
enableTooltip
trueShow a tooltip on task-bar hover.
tooltipId
'apexgantt-tooltip-container'HTML id for the tooltip container element.
tooltipTemplate
Custom function returning an HTML string for the task tooltip.
tooltipTemplate(task, dateFormat) {
return `
<div>
<div><strong>Task:</strong> ${task.name}</div>
<div><strong>Start:</strong> ${task.startTime}</div>
<div><strong>End:</strong> ${task.endTime}</div>
<div><strong>Progress:</strong> ${task.progress}%</div>
</div>
`;
}
tooltipBGColor
'#FFFFFF'Background color of the hover tooltip.
tooltipBorderColor
'#BCBCBC'Border color of the hover tooltip.
fontColor
'#000000'Color for all text in the chart.
fontFamily
'sans-serif'CSS font-family for the chart. Falls back to the page default when empty.
fontSize
'14px'CSS font-size for the chart.
fontWeight
'400'CSS font-weight for the chart.
annotationBgColor
'#DBEAFE'Background color of annotation markers.
annotationBorderColor
'#60A5FA'Border color of annotation markers.
annotationBorderDashArray
[]SVG stroke-dasharray for annotation borders, e.g. [6, 3].
annotationBorderWidth
2Border width of annotation markers in pixels.
annotationOrientation
'horizontal'Whether annotation lines are drawn horizontally or vertically.
Available Options:
- horizontal (default)
- vertical
enableProjectBoundary
falseWhen true, two vertical lines mark the project's earliest start and latest end across all rows. Auto-recomputes when tasks are added, removed, or rescheduled.
Available Options:
- false (default)
- true
projectBoundaryColor
'#7C3AED'Stroke color for the project-boundary lines. Falls back to annotationBorderColor when omitted.
columnConfig
Custom column definitions for the task-list panel. When omitted, all default columns are shown.
key
Column identifier. Use a ColumnKey value for built-ins ('name', 'startTime', 'endTime', 'duration', 'progress', 'progressRing', 'wbs') or any other string for a custom column paired with a render function.
title
Header label displayed at the top of the column.
minWidth
CSS min-width for the column, e.g. '120px'.
flexGrow
CSS flex-grow factor for the column.
visible
Whether the column is visible. Defaults to true.
render
Custom cell renderer. Required for custom columns; ignored for built-in columns. Receives a context object (task, options, rowIndex, isSummary, isMilestone) and the cell element. Return an HTML string to set innerHTML, return void if you mounted DOM yourself, or return a cleanup function () => void that the library will invoke on row eviction, full re-render, and destroy() — required for framework adapters (React.createRoot().unmount(), Vue.app.unmount(), etc.).
accessor
Extracts the underlying value of the cell from the task. Used by SVG export and reserved for future sort/filter features.
toolbarItems
[]Custom controls rendered in the toolbar alongside the built-in zoom and export buttons. Each item can be a ToolbarButton, ToolbarSelect, or ToolbarSeparator. Use position: 'left' to insert before the built-in controls (default is 'right').
taskListAriaLabel
'Task list'aria-label for the task-list table, used by screen readers.
parsing
Field-mapping config to parse non-standard task shapes without manual data transformation.
parsing: {
id: 'task_id',
name: 'title',
startTime: 'start_date',
endTime: 'end_date',
progress: { key: 'pct_complete', transform: Number },
}
id
Path to the unique task identifier in the raw data object.
name
Path to the task display name in the raw data object.
startTime
Path to the task start date in the raw data object.
endTime
Path to the task end date in the raw data object.
progress
Path to the task progress value in the raw data object.
type
Path to the task type ('task' or 'milestone') in the raw data object.
parentId
Path to the parent task ID in the raw data object.
dependency
Path to the dependency field in the raw data object.
barBackgroundColor
Path to a per-task bar color override in the raw data object.
rowBackgroundColor
Path to a per-task row background color override in the raw data object.
collapsed
Path to the collapsed state in the raw data object.
series
Task data array. Each item must satisfy TaskInput, or use parsing to map custom field names.
series: [
{
id: 'task-1',
name: 'Design Phase',
startTime: '01-01-2026',
endTime: '01-15-2026',
progress: 65,
},
{
id: 'task-2',
name: 'Development',
startTime: '01-10-2026',
endTime: '02-01-2026',
parentId: 'task-1',
progress: 30,
dependency: 'task-1',
},
]
id
Unique identifier for the task. Must be stable across renders.
name
Display name shown in the task list column and task bar.
startTime
Task start date string. Parsed using inputDateFormat.
endTime
Task end date string. Parsed using inputDateFormat. When omitted, the task renders as a milestone on startTime.
progress
Completion percentage (0–100). Renders a filled progress portion inside the task bar.
type
Visual type of the task.
Available Options:
- task — renders a bar (default)
- milestone — renders a diamond marker
parentId
ID of the parent task. Nested tasks are rendered as children in the task list.
dependency
Dependency on another task. Accepts either a plain task ID string (treated as Finish-to-Start with 0 lag) or a full TaskDependency object for typed dependency with lag/lead support.
// Simple string dependency
dependency: 'task-2'
// Full dependency object
dependency: { taskId: 'task-2', type: 'FS', lag: 2 }
barBackgroundColor
Override the task bar fill color for this specific task.
rowBackgroundColor
Override the row background color for this specific task row.
baseline
Baseline (planned) dates for comparison against actual dates. Rendered as a thin bar below the actual task bar when baseline.enabled is true.
start
Planned (baseline) start date of the task.
end
Planned (baseline) end date of the task.
collapsed
Whether this task's child tasks are collapsed (hidden) in the task list.
showSummaryBar
When true (the default), a task with children renders as a summary (group) bar whose date range is automatically computed from the earliest start and latest end of all its descendants — the task's own startTime / endTime are ignored. Drag, resize, and progress edits are disabled on summary bars. Set to false to opt the parent out of the auto-derived summary bar and render it as a normal task bar instead.
assignees
People (or teams) assigned to this task. Consumed by the built-in renderers.avatars column renderer; ignored unless an avatar-style column is configured via columnConfig. Each Assignee carries name, optional avatarUrl, optional initials, and optional fallback color.
annotations
Array of annotation objects to overlay on the timeline.
annotations: [
{
x1: '01-15-2026',
x2: '01-20-2026',
label: { text: 'Sprint Review' },
},
{
x1: '02-01-2026',
label: { text: 'Deadline' },
},
]
x1
Start date of annotation.
x2
End date of annotation. If present, draws a rect from x1 to x2. If null or omitted, only draws a line on x1.
bgColor
Background color of this annotation. Overrides the global annotationBgColor.
borderColor
Border color of this annotation. Overrides the global annotationBorderColor.
borderDashArray
SVG stroke-dasharray for this annotation's border.
borderWidth
Border width of this annotation in pixels.
label
Label configuration for the annotation.
text
Label text for the annotation.
fontColor
Font color for the annotation label.
fontFamily
Font family for the annotation label.
fontSize
Font size for the annotation label.
fontWeight
Font weight for the annotation label.
orientation
Text orientation of the annotation label.
Available Options:
- horizontal
- vertical