Quickstart
Write a minimal specification and render it as SVG or as an HTML figure.
Write a specification
Save a minimal specification as spec.json:
{
"schemaVersion": 1,
"type": "bar",
"title": "Monthly revenue",
"data": [
{ "label": "January", "value": 120 },
{ "label": "February", "value": 180 },
{ "label": "March", "value": 150 }
]
}
Render it
chartlet render spec.json --format html -o chart.html
--format html produces a <figure> with caption, SVG, source and data table. Leave the option out
for a standalone SVG. Pass - instead of a file name to read the specification from standard
input.
Next steps
- All fields are in the specification reference.
- Grouped bars, horizontal bars and lines are covered in Chart types.
- To render charts while an Astro site builds, see Astro.