Quickstart
Install boardplot, write a JSON spec and render your first chart. The same spec works in React.
The package needs Node.js 22.12 or newer. This page was built with boardplot 0.63.0, which drew the chart of step 3 from the spec of step 2.
01Install
npm install boardplot02Write a spec
A spec is one JSON object. type and data are required. options and annotations are optional. Set a chart theme in options.theme, for example "theme": "notation" inside options. Save this as revenue-mix.json:
{
"name": "revenue-mix",
"type": "column",
"data": {
"categories": ["2021", "2022", "2023", "2024", "2025"],
"series": [
{ "id": "subscriptions", "label": "Subscriptions", "values": [62, 74, 88, 103, 121] },
{ "id": "services", "label": "Services", "values": [38, 41, 43, 44, 46] }
]
},
"annotations": [{ "kind": "cagr" }],
"options": {
"variant": "stacked",
"title": "Subscriptions carry the growth",
"subtitle": { "measure": "Revenue by line" },
"unit": "$m"
}
}03Render it
npx boardplot render revenue-mix.json --out chartsThis writes charts/revenue-mix.svg and prints the result as JSON. The library adds the column totals and works out the average yearly growth rate that the arrow shows. Add --format png for a PNG.
Subscriptions carry the growth
Stacked columns of revenue by line from 2021 to 2025: the total grows from $100m to $167m, 14 percent a year, and subscriptions grow from $62m to $121m while services grow from $38m to $46m.
JSON spec
This spec includes the theme shown and the options you selected.
{
"name": "revenue-mix",
"type": "column",
"data": {
"categories": [
"2021",
"2022",
"2023",
"2024",
"2025"
],
"series": [
{
"id": "subscriptions",
"label": "Subscriptions",
"values": [
62,
74,
88,
103,
121
]
},
{
"id": "services",
"label": "Services",
"values": [
38,
41,
43,
44,
46
]
}
]
},
"annotations": [
{
"kind": "cagr"
}
],
"options": {
"variant": "stacked",
"title": "Subscriptions carry the growth",
"subtitle": {
"measure": "Revenue by line"
},
"unit": "$m"
}
}04Find the chart you need
npx boardplot list shows every chart type. npx boardplot fixtures --type waterfall prints complete example specs to start from (boardplot calls them fixtures), and npx boardplot fixtures --id <fixture ID> prints one of them. Every example in the gallery shows its spec and, when it comes from the package, its fixture ID. To draw charts from an AI agent, see For AI agents.
05Use it in React (optional)
To use the React components, install React 18 or 19 and the matching react-dom.
npm install boardplot react react-domEach chart type has its own entry, such as boardplot/react/column. It takes the options as props:
import { ColumnChart } from 'boardplot/react/column';
const data = {
categories: ['2021', '2022', '2023', '2024', '2025'].map((year) => ({ id: year, label: year })),
series: [
{ id: 'subscriptions', label: 'Subscriptions', values: [62, 74, 88, 103, 121] },
{ id: 'services', label: 'Services', values: [38, 41, 43, 44, 46] },
],
};
export function RevenueMix() {
return (
<ColumnChart data={data} variant="stacked" annotations={[{ kind: 'cagr' }]}
title="Subscriptions carry the growth" unit="$m" size="container" fit="content" />
);
}BoardplotChart from boardplot/react/spec takes a whole spec instead and loads the code of each chart type when it is needed. This site uses it.
import { BoardplotChart } from 'boardplot/react/spec';
export function Chart({ spec }) {
return <BoardplotChart spec={spec} size="container" fit="content" hover />;
}Requirements and limits
- The package ships ES modules.
importworks everywhere, andrequire()also loads it on Node.js 22.12 or newer. - The library is at version 0.x: options and output can change between minor versions. The changelog lists each change.
Next: the manual covers the spec, the CLI, React, sizing, errors and themes. The chart reference has one page per chart type.