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 Parameter | Default type |
|---|---|
TData | unknown |
Parameters
| Parameter | Type |
|---|---|
target | string | Context<Element, Record<string, unknown>> | HTMLElement |
options | GanttChartOptions<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',
});