Options

Configuration Structure

Options: {
theme: ThemeMode,
annotationBgColor: string,
annotationOrientation: Orientation,
annotations: Annotation[],
bgColor: string,
borderColor: string,
borderDashArray: number,
borderWidth: number,
label: AnnotationLabel,
fontColor: string,
fontFamily: string,
fontSize: string,
fontWeight: string,
orientation: Orientation,
text: string,
x1: string,
x2: null | string,
arrowColor: string,
backgroundColor: string,
barBackgroundColor: string,
barBorderRadius: string,
barMargin: number,
barTextColor: string,
baseline: { ... },
enabled: boolean,
color: string,
borderColor: string,
canvasStyle: string,
criticalBarColor: string,
criticalArrowColor: string,
enableCriticalPath: boolean,
cellBorderColor: string,
cellBorderWidth: string,
columnConfig: ColumnListItem[],
key: ColumnKey,
title: string,
minWidth: string,
flexGrow: number,
visible: boolean,
enableSelection: boolean,
enableExport: boolean,
enableResize: boolean,
enableTaskDrag: boolean,
enableTaskEdit: boolean,
enableTaskResize: boolean,
enableTooltip: boolean,
fontColor: string,
fontFamily: string,
fontSize: string,
fontWeight: string,
headerBackground: string,
height: number | string,
inputDateFormat: string,
rowBackgroundColors: string[],
rowHeight: number,
series: Array,
id: string,
name: string,
startTime: string,
endTime: string,
progress: number,
type: TaskType,
parentId: string,
dependency: string | TaskDependency,
barBackgroundColor: string,
rowBackgroundColor: string,
baseline: BaselineInput,
start: string,
end: string,
collapsed: boolean,
tasksContainerWidth: number,
tooltipBGColor: string,
tooltipBorderColor: string,
tooltipId: string,
tooltipTemplate: Function,
viewMode: ViewMode,
width: number | string,
parsing: ParsingConfig,
id: ParsingValue,
name: ParsingValue,
startTime: ParsingValue,
endTime: ParsingValue,
progress: ParsingValue,
type: ParsingValue,
parentId: ParsingValue,
dependency: ParsingValue,
barBackgroundColor: ParsingValue,
rowBackgroundColor: ParsingValue,
collapsed: ParsingValue,
showCheckboxColumn: boolean,
toolbarItems: ToolbarItem[],
taskListAriaLabel: string,
}

theme

Default: 'light'

Color theme preset.

Available Options:

  • light (default)
  • dark

width

Default: '100%'

Width of the chart. Accepts a pixel number or a CSS string.

height

Default: '500px'

Height of the chart. Accepts a pixel number or a CSS string.

canvasStyle

Default: 'border: 1px solid #CACED0; box-sizing: border-box'

Arbitrary CSS injected onto the root container element.

viewMode

Default: 'week'

Timeline granularity.

Available Options:

  • day
  • week (default)
  • month
  • quarter
  • year

backgroundColor

Default: '#FFFFFF'

Background color of the whole chart container.

headerBackground

Default: '#EBF3FB'

Background color of the timeline and task-list header row.

borderColor

Default: '#DFE0E1'

Color of the cell and row divider lines.

cellBorderColor

Default: '#E3EDF8'

Border color for all cells in the task table and timeline grid.

cellBorderWidth

Default: '1px'

CSS border-width for all cell lines.

inputDateFormat

Default: 'MM-DD-YYYY'

dayjs-compatible format string used to parse startTime / endTime values.

tasksContainerWidth

Default: 425

Initial pixel width of the task-list panel.

enableResize

Default: true

Allow the task-list panel to be resized by dragging the divider.

enableExport

Default: true

Show the SVG export button in the toolbar.

arrowColor

Default: '#1A6FC4'

Color of dependency arrows between tasks.

barBackgroundColor

Default: '#318CE7'

Default background fill color for task bars.

barBorderRadius

Default: '5px'

CSS border-radius applied to task bars.

barMargin

Default: 8

Top and bottom margin inside each row for the task bar in pixels.

barTextColor

Default: '#FFFFFF'

Text color rendered inside task bars.

rowBackgroundColors

Default: ['#FFFFFF']

Alternating row background colors. The pattern cycles automatically.

rowHeight

Default: 38

Height of each task row in pixels.

enableTaskDrag

Default: true

Allow tasks to be reordered by dragging rows in the task list.

enableTaskEdit

Default: false

Show the inline task-edit form when a task row is clicked.

enableTaskResize

Default: true

Allow task bars to be resized by dragging their handles.

enableSelection

Default: false

Enable row selection (click, Ctrl+Click, Shift+Click, keyboard).

showCheckboxColumn

Default: true

Show a checkbox column for multi-select. Only applies when enableSelection is true.

enableCriticalPath

Default: false

When true, calculates and highlights the critical path through dependent tasks.

criticalBarColor

Default: '#e53935'

Fill color for task bars on the critical path (requires enableCriticalPath: true).

criticalArrowColor

Default: '#e53935'

Stroke color for dependency arrows on the critical path.

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

Options.baseline.enabled
Default: false

Whether to render baseline bars below actual bars.

color

Options.baseline.color
Default: '#b0b8c1'

Color of the baseline bar.

enableTooltip

Default: true

Show a tooltip on task-bar hover.

tooltipId

Default: '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

Default: '#FFFFFF'

Background color of the hover tooltip.

tooltipBorderColor

Default: '#BCBCBC'

Border color of the hover tooltip.

fontColor

Default: '#000000'

Color for all text in the chart.

fontFamily

Default: 'sans-serif'

CSS font-family for the chart. Falls back to the page default when empty.

fontSize

Default: '14px'

CSS font-size for the chart.

fontWeight

Default: '400'

CSS font-weight for the chart.

annotationBgColor

Default: '#DBEAFE'

Background color of annotation markers.

annotationBorderColor

Default: '#60A5FA'

Border color of annotation markers.

annotationBorderDashArray

Default: []

SVG stroke-dasharray for annotation borders, e.g. [6, 3].

annotationBorderWidth

Default: 2

Border width of annotation markers in pixels.

annotationOrientation

Default: 'horizontal'

Whether annotation lines are drawn horizontally or vertically.

Available Options:

  • horizontal (default)
  • vertical

columnConfig

Custom column definitions for the task-list panel. When omitted, all default columns are shown.

key

Options.columnConfig.key

Column identifier. One of 'name', 'startTime', 'endTime', 'duration', or 'progress'.

title

Options.columnConfig.title

Header label displayed at the top of the column.

minWidth

Options.columnConfig.minWidth

CSS min-width for the column, e.g. '120px'.

flexGrow

Options.columnConfig.flexGrow

CSS flex-grow factor for the column.

visible

Options.columnConfig.visible

Whether the column is visible. Defaults to true.

toolbarItems

Default: []

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

Default: '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

Options.parsing.id

Path to the unique task identifier in the raw data object.

name

Options.parsing.name

Path to the task display name in the raw data object.

startTime

Options.parsing.startTime

Path to the task start date in the raw data object.

endTime

Options.parsing.endTime

Path to the task end date in the raw data object.

progress

Options.parsing.progress

Path to the task progress value in the raw data object.

type

Options.parsing.type

Path to the task type ('task' or 'milestone') in the raw data object.

parentId

Options.parsing.parentId

Path to the parent task ID in the raw data object.

dependency

Options.parsing.dependency

Path to the dependency field in the raw data object.

barBackgroundColor

Options.parsing.barBackgroundColor

Path to a per-task bar color override in the raw data object.

rowBackgroundColor

Options.parsing.rowBackgroundColor

Path to a per-task row background color override in the raw data object.

collapsed

Options.parsing.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

Options.series.id

Unique identifier for the task. Must be stable across renders.

name

Options.series.name

Display name shown in the task list column and task bar.

startTime

Options.series.startTime

Task start date string. Parsed using inputDateFormat.

endTime

Options.series.endTime

Task end date string. Parsed using inputDateFormat. When omitted, the task renders as a milestone on startTime.

progress

Options.series.progress

Completion percentage (0–100). Renders a filled progress portion inside the task bar.

type

Options.series.type

Visual type of the task.

Available Options:

  • task — renders a bar (default)
  • milestone — renders a diamond marker

parentId

Options.series.parentId

ID of the parent task. Nested tasks are rendered as children in the task list.

dependency

Options.series.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

Options.series.barBackgroundColor

Override the task bar fill color for this specific task.

rowBackgroundColor

Options.series.rowBackgroundColor

Override the row background color for this specific task row.

baseline

Options.series.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

Options.series.baseline.start

Planned (baseline) start date of the task.

end

Options.series.baseline.end

Planned (baseline) end date of the task.

collapsed

Options.series.collapsed

Whether this task's child tasks are collapsed (hidden) in the task list.

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

Options.annotations.x1

Start date of annotation.

x2

Options.annotations.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

Options.annotations.bgColor

Background color of this annotation. Overrides the global annotationBgColor.

borderColor

Options.annotations.borderColor

Border color of this annotation. Overrides the global annotationBorderColor.

borderDashArray

Options.annotations.borderDashArray

SVG stroke-dasharray for this annotation's border.

borderWidth

Options.annotations.borderWidth

Border width of this annotation in pixels.

label

Options.annotations.label

Label configuration for the annotation.

text

Options.annotations.label.text

Label text for the annotation.

fontColor

Options.annotations.label.fontColor

Font color for the annotation label.

fontFamily

Options.annotations.label.fontFamily

Font family for the annotation label.

fontSize

Options.annotations.label.fontSize

Font size for the annotation label.

fontWeight

Options.annotations.label.fontWeight

Font weight for the annotation label.

orientation

Options.annotations.label.orientation

Text orientation of the annotation label.

Available Options:

  • horizontal
  • vertical