Sparklines
chartAlso known as: sparkline, inline chart, word-sized graphic, spark chart
Description
A sparkline is a small, high-resolution graphic embedded inline with text or data. Coined and popularized by Edward Tufte in Beautiful Evidence (2006), sparklines are “data-intense, design-simple, word-sized graphics.” They strip away axes, labels, gridlines, and legends — everything except the data line itself — to create a visual that fits naturally within a sentence, table cell, or dashboard tile.
Despite their minimal size, sparklines are remarkably informative. A simple line sparkline communicates the general trend (rising, falling, cyclical), volatility (smooth vs. jagged), and approximate range of a time series. When placed in a table column alongside numerical data, sparklines add a temporal dimension that would otherwise require readers to scan multiple rows and mentally reconstruct trends.
The power of sparklines lies in their density and context. By embedding the graphic where the data lives — in the same row as a stock ticker, next to a patient’s vital sign reading, or inline within a narrative sentence — sparklines eliminate the need for the reader to cross-reference between a chart and a table. When an entire column of sparklines is aligned vertically, the viewer can compare trends across entities at a glance, functioning as an ultra-compact form of small multiples.
When to Use
- Adding trend context to tables, dashboards, or reports without taking up significant space
- Showing many time series in parallel (one sparkline per row) for at-a-glance comparison
- Embedding a visual trend indicator inline with text or numerical values
- Providing a “pulse” view of a metric’s recent behavior in monitoring dashboards
When NOT to Use
- When precise values need to be read from the chart — sparklines have no axes or labels; use a full line graph
- When the audience needs to understand the scale or units — use a labeled chart with axes
- When trends are very subtle and require careful comparison — the small size limits precision; use small multiples at a larger size
- When there is only one data point — sparklines need a sequence of values to show a pattern
Anatomy
- Data line: The core element — a thin line (or bar sequence) tracing the trend, with no axes
- Endpoint markers: Optional dots at the first, last, minimum, or maximum values to anchor the eye
- Reference band: An optional shaded region showing a normal range or target zone
- Inline placement: The sparkline sits within text flow or a table cell, vertically centered with surrounding content
- Color: Typically a single color; red may highlight the latest value if it is an outlier
- Win/loss encoding: In bar-style sparklines, positive values go up and negative values go down
Variations
- Line sparkline: The classic form — a simple line tracing a time series
- Bar sparkline: Tiny bars (often just 1-2 pixels wide) showing values over time, useful for discrete intervals
- Win/loss sparkline: Binary bars above/below a centerline showing positive/negative outcomes
- Area sparkline: The area under the line is filled, giving more visual weight to the trend
- Bullet sparkline: Combines a sparkline with a target marker and performance band, used in dashboards
- Band sparkline: A shaded region between two lines showing a range (e.g., high/low temperatures)
Code Reference
// Observable Plot - sparkline (no axes, minimal)
Plot.plot({
height: 40,
axis: null,
marks: [
Plot.line(data, {
x: "date", y: "value",
stroke: "#6366f1", strokeWidth: 1.5
}),
Plot.dot([data[data.length - 1]], {
x: "date", y: "value",
fill: "#f43f5e", r: 3
})
],
x: {axis: null},
y: {axis: null}
})