API Reference
For full TypeScript definitions and detailed signatures, see the generated API documentation.
Properties
| list: TaskList | All tasks and links (read-only). |
| resources: ResourceList | All resources (read-only). |
| sheet: GanttSheet | The sheet (table) component (read-only). |
| selectedTasks: Task[] | Currently selected tasks (read-only). |
| locale: TimelineKitLocale | Shorthand for settings.locale. |
| settings: GanttChartSettings | Settings object — access theme, locale, currency (read-only). |
| events: GanttChartEvents | Event emitters (read-only). |
| canEdit: boolean | Enable/disable editing. Default: true. |
| autoZoomToFit: boolean | Automatically zoom to fit when projectTimeline is set or data is loaded. Default: true. |
| showGridLines: boolean | Show/hide grid lines on the chart. Default: true. |
| showCriticalPath: boolean | Enable/disable critical path highlighting. Default: false. |
| showBaseline: boolean | Show/hide baseline overlay. Default: false. |
| showTodayLine: boolean | Show/hide today indicator line. Default: true. |
| allowTaskSplitting: boolean | Allow splitting tasks into multiple parts via mouse. Default: true. |
| hasBaseline: boolean | Whether a baseline has been saved (read-only). |
| markers: Marker[] | Timeline markers. |
| filter: TaskFilterFn | null | Active task filter function. |
| projectTimeline: DateRange | Project start/end date bounds. |
| workingCalendar: WorkingCalendar | Working calendar (get/set). |
| canUndo$: BehaviorSubject<boolean> | Whether undo is available (observable, read-only). |
| canRedo$: BehaviorSubject<boolean> | Whether redo is available (observable, read-only). |
Methods
| load(json: string): void | Load data from a JSON string. |
| save(): string | Serialize current state to a JSON string. |
| zoomIn(): boolean | Zoom in. Returns false if already at max zoom. |
| zoomOut(): boolean | Zoom out. Returns false if already at min zoom. |
| zoomToFit(tasks?: Task[]): void | Fit the view to show all (or specified) tasks. |
| scrollToDate(date: Date): void | Scroll the timeline to a specific date. |
| scrollToTask(task: Task): void | Scroll to make a task visible (horizontal + vertical). |
| goToProjectStart(): void | Scroll to the project start date. |
| indent(): void | Indent selected tasks (make subtasks). |
| outdent(): void | Outdent selected tasks (promote level). |
| moveUp(): void | Move selected tasks up. |
| moveDown(): void | Move selected tasks down. |
| undo(): void | Undo the last action. |
| redo(): void | Redo the last undone action. |
| copy(): Promise<void> | Copy selected tasks to clipboard. |
| cut(): Promise<void> | Cut selected tasks to clipboard. |
| paste(): Promise<TasksPastedEventArgs | null> | Paste tasks from clipboard. |
| addMarker(marker: Marker): void | Add a timeline marker. |
| removeMarker(marker: Marker): void | Remove a timeline marker. |
| clearMarkers(): void | Remove all timeline markers. |
| clearFilter(): void | Clear the active task filter. |
| saveBaseline(): void | Save current schedule as baseline. |
| clearBaseline(): void | Clear the saved baseline. |
| saveColumns(): ColumnState[] | Save column layout (widths, order, visibility). |
| loadColumns(states: ColumnState[]): void | Restore column layout. |
| exportToImage(): Promise<Blob> | Export chart as PNG. |
| exportToCsv(options?: GanttCsvExportOptions): string | Export as CSV string. |
| exportToPdf(options?: GanttPdfExportOptions): Promise<Blob> | Export as PDF (requires jspdf). |
| exportToExcel(options?: GanttExcelExportOptions): Promise<Blob> | Export as Excel (requires exceljs). |
| destroy(): void | Destroy the chart and release all DOM resources. Called automatically in React and Angular; required for vanilla/direct core usage. |
TaskList Methods
Available via gantt.list.
| createTask(id?: string): Task | Create a new Task wired to the chart's calendar and project timeline, without adding it to the list. Use addTask() to insert it. |
| addTask(task: Task): Task | Add a task to the end of the list. |
| insertTask(index: number, task: Task): Task | Insert a task at a specific position. |
| addEmptyTask(): Task | Append an empty placeholder row at the end. |
| insertEmptyTask(index: number): Task | Insert an empty placeholder row at a specific position. |
| getTask(index: number): Task | Get a task by flat index. |
| getTaskById(id: string): Task | null | Find a task by ID. |
| length: number | Total number of tasks (read-only). |
| removeTask(task: Task): void | Remove a single task. |
| removeTasks(tasks: Task[]): void | Remove multiple tasks. |
| clear(): void | Remove all tasks and links. |
| addLink(from: Task, to: Task, type: TaskLinkType, lag?: Lag): TaskLink | Add a dependency link. |
| removeLink(link: TaskLink): void | Remove a dependency link. |
| existsLinkBetween(from: Task, to: Task): boolean | Check if a link already exists. |
| wouldCreateCycle(from: Task, to: Task): boolean | Check if adding a link would create a cycle. |
| getTasksUsingResource(resource: Resource): Task[] | Find all tasks assigned to a resource. |
| indent(tasks: Task[]): void | Indent tasks (make subtasks of preceding task). |
| outdent(tasks: Task[]): void | Outdent tasks (promote one level). |
| moveUp(tasks: Task[]): void | Move tasks up in the list. |
| moveDown(tasks: Task[]): void | Move tasks down in the list. |
Events
All events are RxJS Subject instances. Subscribe via gantt.events.eventName$.subscribe(callback).
| taskAdded$: Subject<TaskEventArgs> | A task was added. |
| taskChanged$: Subject<TaskEventArgs> | A task property changed. |
| taskRemoved$: Subject<TaskEventArgs> | A task was removed. |
| taskClick$: Subject<TaskEventArgs> | A task bar was clicked. |
| taskDblClick$: Subject<TaskEventArgs> | A task bar was double-clicked. |
| taskContextMenu$: Subject<TaskContextMenuArgs> | Right-click on task bar. |
| chartContextMenu$: Subject<ChartContextMenuArgs> | Right-click on chart area. |
| sheetRowContextMenu$: Subject<TableRowContextMenuEventArgs> | Right-click on sheet row. |
| sheetColumnHeaderContextMenu$: Subject<TableColumnHeaderEventArgs> | Right-click on column header. |
| sheetColumnResized$: Subject<TableColumnEventArgs> | A column was resized. |
| sheetColumnReordered$: Subject<TableColumnEventArgs> | A column was reordered. |
| sheetCellEditing$: Subject<TableCellEditing | null> | Cell editing started (payload) or ended (null). |
| sheetCellDialogEdit$: Subject<DialogEditorArgs> | A cell requires dialog editing (e.g. resources). |
| sheetCellInputEdit$: Subject<InputEditorArgs> | A cell requires input editing. |
| sheetCellInvalidValue$: Subject<void> | An invalid value was entered. |
| linkAdded$: Subject<TaskLinkEventArgs> | A dependency link was added. |
| linkRemoved$: Subject<TaskLinkEventArgs> | A dependency link was removed. |
| tasksPasted$: Subject<TasksPastedEventArgs> | Tasks were pasted from clipboard. |
| projectTimeline$: Subject<DateRange> | Project timeline bounds changed. |
| undone$: Subject<void> | An undo was performed. |
| redone$: Subject<void> | A redo was performed. |
Types & Enums
Task
A schedulable item in the Gantt chart. Can be a Task, Milestone, Summary, or Empty row.
| id: string | Unique identifier (read-only, auto-generated). |
| name: string | null | Display name. Setting a name on an Empty row converts it to a Task. |
| type: TaskType | Current type: 'task' | 'milestone' | 'summary' | 'empty'. |
| startTime: Date | null | Start date/time. Computed from subtasks for Summary tasks. |
| endTime: Date | null | End date/time. Computed from subtasks for Summary tasks. |
| length: Length | null | Computed duration (read-only for Summary). Null for Empty tasks. |
| customLengthUnit: LengthUnit | null | Override for the length display unit. When null, the calendar's default unit is used. |
| progress: number | null | Completion percentage (0–100). Computed for Summary tasks. Null for Empty/Milestone. |
| color: ColorValue | Color index into the theme's taskColors array, or a custom ColorDefinition. Default: 0. |
| note: string | null | Free-form text note. |
| parent: Task | null | Parent summary task (read-only). Null for top-level tasks. |
| collapsed: boolean | Whether a Summary task's subtasks are collapsed. Default: false. |
| level: number | Nesting depth (read-only). 0 for top-level, 1 for first-level subtasks, etc. |
| constraintType: ConstraintType | Scheduling constraint. Default: 'asap'. |
| constraintDate: Date | null | Date for the scheduling constraint. Null for ASAP/ALAP. |
| work: Work | null | Total work effort. Computed from resources, or set manually when none assigned. |
| cost: number | null | Total cost. Computed from resource rates, or set manually. |
| baselineStartTime: Date | null | Baseline start time for variance tracking. |
| baselineEndTime: Date | null | Baseline end time for variance tracking. |
| warnings: string[] | Active warning messages (e.g. behind schedule). |
| filtered: boolean | Whether excluded by the active filter (read-only). |
| hidden: boolean | Whether hidden (filtered out or inside a collapsed Summary, read-only). |
| isCritical: boolean | Whether this task is on the critical path (read-only, computed). |
| earlyStart: Date | null | CPM early start (read-only, computed). |
| earlyFinish: Date | null | CPM early finish (read-only, computed). |
| lateStart: Date | null | CPM late start (read-only, computed). |
| lateFinish: Date | null | CPM late finish (read-only, computed). |
| totalFloat: number | null | Total float in working hours (read-only, computed). |
| freeFloat: number | null | Free float in working hours (read-only, computed). |
Task also supports custom properties via addProperty(), getPropertyValue(), setPropertyValue(), and removeProperty().
TaskLink
A dependency link between two tasks.
| id: string | Unique identifier (read-only). |
| from: Task | Predecessor task (read-only). |
| to: Task | Successor task (read-only). |
| type: TaskLinkType | Dependency type (read-only). |
| lag: Lag | Time offset applied to the dependency (read-only). |
Resource
A named resource (person, equipment, etc.) that can be assigned to tasks.
| id: string | Unique identifier (read-only). |
| name: string | Display name. |
| type: ResourceType | 'unique' | 'generic'. |
| rate: Rate | null | Hourly or daily cost rate. |
| fixedCostPerUse: number | Fixed cost charged each time this resource is used. Default: 0. |
| fixedCostPerResource: number | Fixed cost per resource assignment. Default: 0. |
| avatarIconUrl: string | null | URL to an avatar image. Default: null. |
TaskResource
Assignment of a resource to a task with a capacity percentage.
| id: string | Unique identifier (read-only). |
| resource: Resource | The underlying resource definition (read-only). |
| capacity: number | Allocation percentage (100 = full-time, 200 = double allocation). |
TaskPart
A contiguous time segment of a split task.
| startTime: Date | Start date/time of this part. |
| endTime: Date | End date/time of this part. |
| length: Length | Duration of this part. |
WorkingCalendar
Defines working days, shifts, and holidays for scheduling calculations.
| workingDays: DayOfWeek[] | Days of the week that are working days. Default: Mon–Fri. |
| nationalHolidays: Date[] | Dates that are non-working regardless of the day. Default: []. |
| shifts: WorkingShift[] | Working time ranges within each day. Default: 8:00–12:00, 13:00–17:00. |
| startOfWeek: DayOfWeek | First day of the week for calendar display. Default: 'sunday'. |
| defaultLengthUnit: LengthUnit | Default unit for new task durations. Default: 'day'. |
Methods
| isWorkingDay(date: Date): boolean | Check whether a date falls on a working day. |
| getHoursPerDay(): number | Total working hours in a day based on configured shifts. |
| getHoursBetween(time1: Date, time2: Date): number | Working hours between two dates, respecting shifts and non-working days. |
| addHours(date: Date, hours: number): Date | Add/subtract working hours, skipping non-working time. |
WorkingShift
A working time range within a day (e.g. 8:00–12:00).
| start: TimeOfDay | Start time of the shift. |
| end: TimeOfDay | End time of the shift. |
TimeOfDay
A time of day represented as hour and minute.
| hour: number | Hour (0–23). |
| minute: number | Minute (0–59). |
DateRange
Project timeline bounds.
| startDate: Date | Start date of the range. |
| endDate: Date | End date of the range. |
Length
Represents a task duration with a time unit. Create via Length.parse('5d') or new Length('day', 5).
| value: number | Numeric amount (read-only). |
| unit: LengthUnit | Time unit (read-only). |
Static methods
| parse(value: string): Length | Parse a length string (e.g. '5d', '2w'). Throws on invalid input. |
| tryParse(value: string): Length | null | Parse a length string. Returns null if invalid. |
| getLength(start: Date, end: Date, unit: LengthUnit, calendar: WorkingCalendar): Length | Calculate duration between two dates. |
Lag
Time offset (positive or negative) applied to a dependency link. Create via Lag.parse('+2d').
| value: number | Numeric amount — positive = lag, negative = lead (read-only). |
| unit: LengthUnit | Time unit (read-only). |
Static methods
| parse(value: string): Lag | Parse a lag string (e.g. '+2d', '-1h'). Throws on invalid input. |
| tryParse(value: string): Lag | null | Parse a lag string. Returns null if invalid. |
| zero(): Lag | Create a zero lag (0 days). |
Work
Represents a work effort amount with a time unit. Create via Work.tryParse('40h').
| value: number | Numeric amount (read-only). |
| unit: WorkUnit | Time unit (read-only). |
Rate
Cost rate associated with a resource.
| value: number | Monetary value of the rate (read-only). |
| type: RateType | 'perDay' | 'perHour' (read-only). |
Marker
A vertical date marker displayed on the chart.
| date: Date | Date position of the marker line. |
| label?: string | Optional text label. |
| color?: string | CSS color string. |
| lineWidth?: number | Width of the marker line in pixels. |
| lineStyle?: 'solid' | 'dashed' | 'dotted' | Dash style of the marker line. |
CustomProperty
Custom task property (name + value).
| name: string | Property name. |
| value: any | Property value. |
GanttChartSettings
Gantt chart settings — theme, locale, and currency configuration.
| theme: GanttChartTheme | Current theme. |
| locale: TimelineKitLocale | Current locale. |
| currencySymbol: string | Currency symbol used in cost columns. Default: '$'. |
| currencySymbolDisplayMode: CurrencySymbolDisplayMode | How the currency symbol is positioned relative to the amount. Default: 'beforeAmountWithSpace'. |
ColumnState
Saved column layout state.
| code: string | Column identifier. |
| width: number | Column width in pixels. |
| isVisible: boolean | Whether the column is visible. |
ColorDefinition
Custom color definition that can be used instead of a theme color index. All properties except color1 and color2 are optional — unspecified values are inherited from the first theme palette entry.
| color1: string | Primary fill color (top of gradient). |
| color2: string | Secondary fill color (bottom of gradient). |
| highlightColor?: string | Hover/highlight overlay color. |
| borderColor?: string | null | Border color. Null = no border. |
| progressColor1?: string | Primary progress bar fill color (top of gradient). |
| progressColor2?: string | Secondary progress bar fill color (bottom of gradient). |
| progressHighlightColor?: string | Progress bar hover/highlight overlay color. |
Event args types
TaskEventArgs
| task: Task | The task that triggered the event. |
TaskLinkEventArgs
| link: TaskLink | The link that was added or removed. |
TaskContextMenuArgs
| task: Task | The task that was right-clicked. |
| mouseEvent: MouseEvent | The native mouse event. |
ChartContextMenuArgs
| date: Date | Date at the click position. |
| area: 'header' | 'content' | Whether the click was on the header or the content area. |
| task: Task | null | Task at the click position, or null. |
| mouseEvent: MouseEvent | The native mouse event. |
TasksPastedEventArgs
| tasks: Task[] | The pasted tasks. |
| links: TaskLink[] | The pasted links. |
| taskIdMap: Map<string, Task> | Maps original task ID → pasted task. |
| droppedLinks: DroppedLinkInfo[] | Links that could not be recreated. |
DroppedLinkInfo
| type: TaskLinkType | Original link type. |
| fromId: string | Original predecessor task ID. |
| toId: string | Original successor task ID. |
| externalSide: 'from' | 'to' | Which end is outside the pasted set. |
Export options
GanttCsvExportOptions
| delimiter?: ',' | ';' | '\t' | Column delimiter. Default: ','. |
| includeHeaders?: boolean | Include column headers. Default: true. |
| columns?: string[] | Which columns to export (by code). Default: all visible. |
| includeLinks?: boolean | Append dependency links as a separate section. Default: false. |
GanttPdfExportOptions
| pageSize?: 'A4' | 'A3' | 'Letter' | 'Legal' | Page format. Default: 'A4'. |
| orientation?: 'portrait' | 'landscape' | Page orientation. Default: 'landscape'. |
| margin?: { top, right, bottom, left } | Page margins in mm. Default: 10mm on all sides. |
| header?: string | ((page, total) => string) | Header text on each page. |
| footer?: string | ((page, total) => string) | Footer text on each page. |
| includeSheet?: boolean | Include the sheet (left panel). Default: true. |
| includeChart?: boolean | Include the chart (timeline). Default: true. |
| quality?: number | Image quality (0–1). Default: 1. |
| fitToSinglePage?: boolean | Export as a single page. Default: false. |
GanttExcelExportOptions
| sheetName?: string | Name of the tasks sheet. Default: 'Tasks'. |
| includeLinksSheet?: boolean | Include a sheet with dependency links. Default: true. |
| includeResourcesSheet?: boolean | Include a sheet with resources. Default: true. |
| includeFormatting?: boolean | Apply cell formatting (bold summaries, column widths). Default: true. |
| columns?: string[] | Which columns to export (by code). Default: all visible. |
TaskFilters
Built-in filter predicates. Each is a TaskFilterFn or a factory that returns one.
| criticalPath | Tasks on the critical path. |
| incomplete | Tasks with progress below 100%. |
| complete | Tasks with 100% progress. |
| behindSchedule | Tasks past their end date with incomplete progress. |
| milestones | Milestone tasks only. |
| byResource(resource: Resource) | Tasks assigned to a specific resource. |
| byDateRange(start: Date, end: Date) | Tasks overlapping a date range. |
| byName(search: string) | Tasks whose name contains the search string (case-insensitive). |
| combine(...filters: TaskFilterFn[]) | Combines multiple filters with AND logic. |
Enums
TaskType
| 'task' | A regular schedulable task with start, end, and duration. |
| 'milestone' | A zero-duration event marking a key date. |
| 'summary' | A parent task whose dates and progress are computed from subtasks. |
| 'empty' | An empty row placeholder. |
TaskLinkType
| 'finishToStart' | Successor starts after predecessor finishes (most common). |
| 'startToStart' | Both tasks start at the same time. |
| 'finishToFinish' | Both tasks finish at the same time. |
| 'startToFinish' | Successor finishes when predecessor starts. |
ConstraintType
| 'asap' | As Soon As Possible (default). |
| 'alap' | As Late As Possible. |
| 'mso' | Must Start On — task must start on the constraint date. |
| 'mfo' | Must Finish On — task must finish on the constraint date. |
| 'snet' | Start No Earlier Than — task cannot start before the constraint date. |
| 'snlt' | Start No Later Than — task cannot start after the constraint date. |
| 'fnet' | Finish No Earlier Than — task cannot finish before the constraint date. |
| 'fnlt' | Finish No Later Than — task cannot finish after the constraint date. |
LengthUnit
| 'minute' | Duration in minutes. |
| 'hour' | Duration in hours. |
| 'day' | Duration in working days (default). |
| 'week' | Duration in weeks. |
| 'month' | Duration in months. |
WorkUnit
| 'minute' | Work effort in minutes. |
| 'hour' | Work effort in hours. |
| 'day' | Work effort in days. |
DayOfWeek
| 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday' | Day of the week. |
ResourceType
| 'unique' | A unique resource (e.g. a specific person). |
| 'generic' | A generic resource (e.g. 'Developer' role). |
RateType
| 'perDay' | Cost rate per working day. |
| 'perHour' | Cost rate per working hour. |
ConnectorSide
| 'start' | 'finish' | Which end of a task a link connects to. |
ColorValue
| number | ColorDefinition | A theme color index (number) or a custom color definition. |
TaskFilterFn
| (task: Task) => boolean | Predicate function used to filter tasks. |
TaskLabelPosition
| 'none' | No label. |
| 'inside' | Label inside the task bar. |
| 'right' | Label to the right of the task bar. |
| 'insideOrRight' | Inside if it fits, otherwise to the right. |
TaskLabelContent
| 'name' | Display task name. |
| 'resource' | Display assigned resource names. |
| 'progress' | Display progress percentage. |
| 'nameAndProgress' | Display name and progress. |
| 'nameAndResource' | Display name and resource names. |
SummaryMarkType
| 'full' | Full triangle marks at both ends. |
| 'half' | Half-height marks at both ends. |
CurrencySymbolDisplayMode
| 'beforeAmount' | Symbol directly before amount ($100). |
| 'afterAmount' | Symbol directly after amount (100$). |
| 'beforeAmountWithSpace' | Symbol before amount with space ($ 100). |
| 'afterAmountWithSpace' | Symbol after amount with space (100 $). |
Utility functions
| getLinkType(from: ConnectorSide, to: ConnectorSide): TaskLinkType | Determine the link type from which sides of the tasks are connected. |