Gantt

A gantt draws each task as a bar on a calendar. The bar runs from start to end. Sections group the rows. A milestone is a diamond. A dependency is an elbow from one task to the next.

When to use it

Use a gantt when the question is when the work happens, what it depends on, and how far along it is. Northstar launch is that chart: plan, build, and launch, with a today line and two milestones. Prep lanes for Cinder is the same idea for one vehicle.

A bar compares amounts. The categories are not dates, the bar starts from a baseline, and nothing depends on another bar. A timeline places events and eras on a date line. It does not give each row a task bar, a progress fill, or a dependency.

A handful of tasks stays readable. Paper Kite has four. Northstar launch has eight. A long list of named amounts, with no dates, is a bar.

Gantt, timeline, and bar

All three can put a name next to a mark. The axis is what changes.

type: "gantt" maps time to the horizontal axis. start and end are calendar days. The bar's length is the span, not a measure from zero. depends draws an elbow between task ids.

type: "timeline" is the event chart. A point is one day. A period is a rounded span. There is no task id and no dependency.

type: "bar" is the comparison. type: "bar-range" floats a bar between two numbers on a value axis. That pair is not a start date and an end date.

Data

Each row is one task. task is the name. start is YYYY-MM-DD. end is the last day, or omit it and set duration as a number of days or a string such as 5d or 2w. id is how another row names this task.

section groups rows. Northstar launch uses Plan, Build, and Launch. Leave it off and the tasks are one list. Point encoding.y at the section field when the column has another name. encoding.x is the task, encoding.open and encoding.close are the dates, encoding.color is the status, and encoding.source and encoding.target are the id and the dependency. The default names are task, section, start, end, status, id, and depends, so a small spec can omit encoding.

status is done, active, or crit. complete and completed count as done. wip counts as active. critical and delayed count as crit. Done uses the positive color, active the accent, and crit the negative color. Any other status uses the first series color. The chart draws a Done, Active, and Critical key with the chart. That key is not legend.

progress fills the bar, from 0 to 1. A number from 1 to 100 is read as a percent. Omit it and the bar is solid. depends is a comma-separated list of task ids. The elbow runs from the predecessor to this task. A missing id is reported by validatePhase4 as CK1404.

milestone: true draws a diamond on start. A duration of 0, or the same start and end, is a milestone too. A today date on any row draws a dashed line when that day sits inside the range. Northstar launch sets it on the first task.

a11y.alt is required. One sentence, 10 to 500 characters, with the point of the chart.

one task
{
  "id": "web",
  "task": "Build the web app",
  "section": "Build",
  "start": "2026-03-23",
  "end": "2026-04-10",
  "progress": 0.3,
  "status": "crit",
  "depends": "design"
}

A spec that renders

This is the smallest gantt. version, type, and a11y.alt are required. Task A has a start and an end. Task B is a milestone that depends on A. The field names are the defaults, so encoding can be omitted.

The chart loads from @chartkitdev/core/charts/gantt, or from @chartkitdev/core/extra. It is not in the line bundle. validate() warns CK1011 and points at validatePhase4(), which checks the dates and the dependencies. A missing start is CK1401. A row with no end, duration, or milestone is CK1402.

spec.json
{
  "version": "1",
  "type": "gantt",
  "data": [
    {
      "id": "a",
      "task": "A",
      "start": "2026-03-02",
      "end": "2026-03-13"
    },
    {
      "id": "b",
      "task": "B",
      "start": "2026-04-06",
      "milestone": true,
      "depends": "a"
    }
  ],
  "a11y": {
    "alt": "B follows A."
  }
}

Install core and the adapter for your framework. The menu in the sidebar picks the snippet. spec is the JSON above.

Import@chartkitdev/core/charts/ganttBundle@chartkitdev/core/extraFamilyPlanning
React
npm install @chartkitdev/core
npm install @chartkitdev/react

import { Chart } from "@chartkitdev/react";

export function Panel() {
  return <Chart spec={spec} />;
}
Vanilla
npm install @chartkitdev/core
npm install @chartkitdev/vanilla

import { mount } from "@chartkitdev/vanilla";

const chart = mount(document.querySelector("#chart"), spec);
chart.update(spec);
Vue
npm install @chartkitdev/core
npm install @chartkitdev/vue

<script setup>
import { Chart } from "@chartkitdev/vue";
</script>

<template>
  <Chart :spec="spec" />
</template>
Svelte
npm install @chartkitdev/core
npm install @chartkitdev/svelte

<script>
  import { Chart } from "@chartkitdev/svelte";
</script>

<Chart {spec} />
Astro
npm install @chartkitdev/core
npm install @chartkitdev/astro

---
import { Chart } from "@chartkitdev/astro";
---

<Chart spec={spec} />
Solid
npm install @chartkitdev/core
npm install @chartkitdev/solid

import { Chart } from "@chartkitdev/solid";

export function Panel() {
  return <Chart spec={spec} />;
}
Qwik
npm install @chartkitdev/core
npm install @chartkitdev/qwik

import { component$ } from "@builder.io/qwik";
import { Chart } from "@chartkitdev/qwik";

export const Panel = component$(() => {
  return <Chart spec={spec} />;
});
Angular
npm install @chartkitdev/core
npm install @chartkitdev/angular

import { Component } from "@angular/core";
import { Chart } from "@chartkitdev/angular";

@Component({
  standalone: true,
  imports: [Chart],
  template: `<ck-chart [spec]="spec" />`,
})
export class Panel {
  spec = spec;
}
Custom element
npm install @chartkitdev/core
npm install @chartkitdev/element

import "@chartkitdev/element";

const chart = document.querySelector("chart-kit");
chart.spec = spec;

The option below is a key on the spec. The demo changes that key and updates the chart and the snippet together.

Examples

The rail switches among existing gantt specs. Northstar launch is the core example: eight tasks, progress, a today line, and two milestones. Paper Kite is the showcase chart from a Mermaid gantt, with sections and one milestone. Prep lanes for Cinder is the launch-manifest chart. The spec has no title, so the switcher uses the showcase heading.

Tooltip

tooltip is on for a gantt when the key is omitted. Hovering a bar or a diamond shows the task, the dates, the status, and the progress when the row has one. The same sentence is the SVG title. tooltip: false tells the hover card not to open. tooltip: true turns it on.

tooltip false
{
  "tooltip": false
}
tooltip true
{
  "tooltip": true
}

tooltip.fields is not read. The card is the mark label, not a field table. Turning the card off and on again puts a custom tooltip object back in the spec. The card still uses the mark label.

The rest of the spec

The Done, Active, and Critical key is part of the chart. It sits beside a short title, and on the next row when the title is long. legend: false does not hide it. legend.position does not move it. There is no mark key for progress, dependencies, milestones, or the today line. Those come from the rows. Theme presets live on the playground.