Charts

Chart.js by default, ApexCharts for gauges. Both read the same JSON block.

8 examples

How to use it

Copy any example below and paste it in
Marker
data-chartjs="line|area|bar|doughnut|pie|radar", or data-chart="radial|donut|area" for ApexCharts.
Data
A <script type="application/json" data-chart-data> inside the container. Keeping it there is what lets the plugin load only where a chart exists.
Options
legend, stacked, horizontal, and format for a currency or percentage axis.
Caption
Becomes the canvas aria-label. A chart is a picture — give it one, and put the figures in a table nearby.
Theme
Series colours come from --color-chart-1…8, the first three of which are the accent. The chrome follows the theme and rebuilds on brutalism:theme.

Area chart with a currency axis

Grouped bars and a doughnut

Radial gauge (ApexCharts)

Stacked bars

Parts of a whole, period by period.

Horizontal bars

For category names too long to fit under a column.

Multi-series line

Three measures on one scale.

Pie and radar

A share breakdown, and a profile across several axes.

Donut gauge with a figure (ApexCharts)

Two radial series on one dial.