Skip to content

Documentation / @ripl/charts / createGanttChart

Function: createGanttChart()

createGanttChart<TData>(target, options): GanttChart<TData>

Defined in: charts/src/charts/gantt.ts:646

Factory function that creates a new GanttChart instance.

Type Parameters

Type ParameterDefault type
TDataunknown

Parameters

ParameterType
targetstring | Context<Element, Record<string, unknown>> | HTMLElement
optionsGanttChartOptions<TData>

Returns

GanttChart<TData>

Example

ts
createGanttChart(target, {
    data: [
        { id: 'design', name: 'Design', from: new Date('2026-01-01'), to: new Date('2026-01-10') },
        { id: 'build', name: 'Build', from: new Date('2026-01-08'), to: new Date('2026-01-24') },
    ],
    key: 'id',
    label: 'name',
    start: 'from',
    end: 'to',
});