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.

← All charts

Live demo

Made-up data. Try the options, then switch to the empty and one-point states.

Cards are buttons: Tab to one and press Enter or Space to show it in the detail chart below.

How to use it

Paste the toolkit from Get the code into your page first, then call the chart like this.

JavaScript
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.

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.