Gallery / Stages, flows and plans /
Gantt chart
A project plan: tasks from start to end on a time axis (Gantt).
78.4 KB of code · core 29.5 + 11 blocks 48.9
Project plan, first half of 2026
On April 15 the build is under way; the plan ends with the release on June 26.
How it is made: A rect spans from x to x2 on a time scale, one band per task on y; tasks read from the top in data order. Color by phase; a rule with a constant x marks today. nice on the time scale runs it from the first of a month, so the month the plan starts in is named; count 6 asks the axis and the grid for every month.
What the report is made of
The composer reads the JSON below and puts into the page the core and only the blocks its chart uses: 11 of the 59, 78.4 KB of code, minified, which is 36% of the 215.9 KB that the core and every block weigh together. The report file is 85.2 KB: that code, the data, the styles and the page around them.
| Block | What it does | Share of the code | KB |
|---|---|---|---|
core.composed-plain A report with plain data: no checks, no decoder. Most reports. | A report with plain data: no checks, no decoder. Most reports. | 29.5 | |
lib.pointer Where the pointer is on the chart, and following a mouse or a finger once a frame. Shared by tooltip, crosshair, zoom and brush. | Where the pointer is on the chart, and following a mouse or a finger once a frame. Shared by tooltip, crosshair, zoom and brush. | 1.7 | |
scale.band One band per category: the axis of bar charts. | One band per category: the axis of bar charts. | 1.2 | |
scale.color A color per category, from the theme palette. | A color per category, from the theme palette. | 0.8 | |
scale.time Dates to positions, ticks in days, months or years (UTC). | Dates to positions, ticks in days, months or years (UTC). | 4.1 | |
mark.rect Rectangles: bars, grouped bars, ranges, heatmap cells; the hexagons of a hexbin. | Rectangles: bars, grouped bars, ranges, heatmap cells; the hexagons of a hexbin. | 4.5 | |
mark.rule Target and threshold lines; the target tick of a bullet chart. | Target and threshold lines; the target tick of a bullet chart. | 3.8 | |
guide.axis Axes: formatted labels, a title, long categories wrapped. | Axes: formatted labels, a title, long categories wrapped. | 11.7 | |
guide.grid Grid lines at the ticks. | Grid lines at the ticks. | 0.6 | |
guide.legend Legends: categories, a color bar, bubble sizes. | Legends: categories, a color bar, bubble sizes. | 6.0 | |
interaction.tooltip The values under the pointer. | The values under the pointer. | 10.7 | |
renderer.svg Draws into SVG: sharp, selectable, prints well. The default. | Draws into SVG: sharp, selectable, prints well. The default. | 3.9 | |
| Total | The core 29.5 and 11 blocks 48.9 | 78.4 |
The JSON
This is the whole input. data holds the datasets, each chart is a spec that names one.
In a checkout of the repository: node scripts/compose.js skills/blockcharts/recipes/gantt.json report.html.
Saved as page.json, it composes the same with the skill's own runtime/compose.js.
gantt.json
{
"title": "Gantt chart",
"data": {
"plan": [
{ "task": "Research", "phase": "Discovery", "start": "2026-01-05", "end": "2026-01-30" },
{ "task": "Requirements", "phase": "Discovery", "start": "2026-01-19", "end": "2026-02-13" },
{ "task": "Design", "phase": "Design", "start": "2026-02-09", "end": "2026-03-13" },
{ "task": "Prototype", "phase": "Design", "start": "2026-03-02", "end": "2026-03-27" },
{ "task": "Backend", "phase": "Build", "start": "2026-03-16", "end": "2026-05-22" },
{ "task": "Frontend", "phase": "Build", "start": "2026-03-30", "end": "2026-06-05" },
{ "task": "Testing", "phase": "Launch", "start": "2026-05-18", "end": "2026-06-19" },
{ "task": "Release", "phase": "Launch", "start": "2026-06-15", "end": "2026-06-26" }
]
},
"charts": [
{
"title": "Project plan, first half of 2026",
"note": "On April 15 the build is under way; the plan ends with the release on June 26.",
"how": "A rect spans from x to x2 on a time scale, one band per task on y; tasks read from the top in data order. Color by phase; a rule with a constant x marks today. nice on the time scale runs it from the first of a month, so the month the plan starts in is named; count 6 asks the axis and the grid for every month.",
"spec": {
"data": "plan",
"size": [720, 340],
"scales": {
"x": { "type": "time", "nice": true },
"y": { "type": "band", "paddingInner": 0.3 },
"color": { "type": "color" }
},
"guides": [
{ "type": "grid", "scale": "x", "count": 6 },
{ "type": "axis", "scale": "x", "format": { "month": "short" }, "count": 6 },
{ "type": "axis", "scale": "y" },
{ "type": "legend", "scale": "color", "position": "auto" }
],
"marks": [
{ "type": "rect", "x": "start", "x2": "end", "y": "task", "color": "phase", "radius": 3 },
{ "type": "rule", "x": { "value": "2026-04-15" }, "dash": [4, 3], "label": "Today" }
],
"interaction": [
{
"type": "tooltip",
"heading": "task",
"fields": ["phase", "start", "end"],
"formats": { "start": { "day": "numeric", "month": "short" }, "end": { "day": "numeric", "month": "short" } }
}
]
}
}
]
}
The report the composer makes from it is one standalone file (85.2 KB): open it from disk, mail it, print it.
In a page of your own
The charts above use the composition kit (54.9 KB gzipped), the smallest one that has the blocks this example needs:
lib.pointer, scale.band, scale.color, scale.time, mark.rect, mark.rule, guide.axis, guide.grid, guide.legend, interaction.tooltip, renderer.svg.
The HTML below loads it from the jsDelivr CDN, pinned to version 0.0.5; to serve it from your own site, put its file there
(the files of a release) and change the address.
HTML
<script src="https://cdn.jsdelivr.net/npm/blockcharts@0.0.5/release/kits/composition.js"></script>
<script type="application/json" id="bc-data">
{"plan":[{"task":"Research","phase":"Discovery","start":"2026-01-05","end":"2026-01-30"},{"task":"Requirements","phase":"Discovery","start":"2026-01-19","end":"2026-02-13"},{"task":"Design","phase":"Design","start":"2026-02-09","end":"2026-03-13"},{"task":"Prototype","phase":"Design","start":"2026-03-02","end":"2026-03-27"},{"task":"Backend","phase":"Build","start":"2026-03-16","end":"2026-05-22"},{"task":"Frontend","phase":"Build","start":"2026-03-30","end":"2026-06-05"},{"task":"Testing","phase":"Launch","start":"2026-05-18","end":"2026-06-19"},{"task":"Release","phase":"Launch","start":"2026-06-15","end":"2026-06-26"}]}
</script>
<script type="application/json" data-bc-chart>
{
"data": "plan",
"size": [
720,
340
],
"scales": {
"x": {
"type": "time",
"nice": true
},
"y": {
"type": "band",
"paddingInner": 0.3
},
"color": {
"type": "color"
}
},
"guides": [
{
"type": "grid",
"scale": "x",
"count": 6
},
{
"type": "axis",
"scale": "x",
"format": {
"month": "short"
},
"count": 6
},
{
"type": "axis",
"scale": "y"
},
{
"type": "legend",
"scale": "color",
"position": "auto"
}
],
"marks": [
{
"type": "rect",
"x": "start",
"x2": "end",
"y": "task",
"color": "phase",
"radius": 3
},
{
"type": "rule",
"x": {
"value": "2026-04-15"
},
"dash": [
4,
3
],
"label": "Today"
}
],
"interaction": [
{
"type": "tooltip",
"heading": "task",
"fields": [
"phase",
"start",
"end"
],
"formats": {
"start": {
"day": "numeric",
"month": "short"
},
"end": {
"day": "numeric",
"month": "short"
}
}
}
],
"alt": "Project plan, first half of 2026"
}
</script>