Sparkline
Use it beside a number to show direction at a glance. It has no scale on purpose, so always print the figure next to it and never use it to compare exact values.
How to use it
Paste the toolkit from Get the code into your page first, then call the chart like this.
row.append(
spark(values, {
w: 120, h: 32,
label: 'Groceries over 12 months, from £402 to £455'
})
);
// columns instead of a line, wider
spark(values, { w: 260, h: 40, bars: true, label: '...' });Options
What you can pass to this chart.
values
Array of numbers. Fewer than 2 draws nothing (a dash for none).
w, h
Size in SVG units (default 120 × 32).
bars
true draws columns, with the latest one highlighted.
fluid
true makes the svg 100% wide (set w to the width you expect).
label
aria-label, e.g. a sentence describing the trend.
More charts like this
Other charts in the “Over time” group.
Calendar
One cell per day, laid out in weeks, to show rhythm and one-off spikes.
View chart →Heatmap
A grid of rows against columns, shaded by value, with clear no-data cells.
View chart →Small multiples
One mini chart per category on a shared layout, with a detail chart for the one you pick.
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.