Small multiples
Use it instead of one crowded multi-line chart, or whenever series have different scales. Each card keeps its own scale, so compare shapes, then click one to read the exact figures.
How to use it
Paste the toolkit from Get the code into your page first, then call the chart like this.
const grid = h('div', { class: 'sm' }, categories.map(c =>
h('button', { class: 'c', type: 'button', 'aria-pressed': String(c === selected),
on: { click: () => select(c) } },
h('span', { class: 'n' }, c),
h('span', { class: 'v' }, money0(latest[c])),
spark(series[c], { w: 150, h: 36, label: c + ' trend' }))));
detail.replaceChildren(lineChart({ xs: months, xlabel: monthName,
series: [{ name: selected, values: series[selected], colour: catColor(selected), area: true }],
height: 200 }));Options
What you can pass to this chart.
grid
A CSS grid of .sm cards (auto-fill, minimum 180px) so it reflows from 1 column to many.
card
Name, latest value, and spark(values, { w: 150, h: 36 }) in a <button class='c'> with aria-pressed.
detail
A lineChart for the selected card, redrawn on click.
More charts like this
Other charts in the “Over time” group.
Line
One or a few series over time, with a typical-value line and an optional comparison.
View chart →Stacked area
Volume over time, split into themes, or the same data as a share of the total.
View chart →Sparkline
A tiny trend with no axes, for tables, tiles and lists.
View chart →Want charts or dashboards like these in your own product?
Tell me what you are trying to see and I can help work out the right approach, from the data behind it to the screen in front of people.