Data Visualization Color
Charts need three kinds of palette, and the choice between them is determined by the data, not by taste.
Definition
Data visualisation uses categorical palettes for unordered groups, sequential palettes for ordered magnitude, and diverging palettes for values around a meaningful midpoint. Using the wrong type misrepresents the data.
Craft convention. True because the industry converged on it. Breaking it costs familiarity, not correctness.
On this plate
Reach for this when
- Building any chart palette.
- Reviewing dashboards for consistency.
- Choosing a scale for a heatmap or choropleth.
Common mistakes
- Rainbow scales for ordered data.
- More than seven categorical series.
- Series colours that change between charts.
- Chart colours colliding with semantic meaning.
- Choosing a palette that looks attractive as swatches and is indistinguishable at one-pixel line width.
Palette types
| Type | Data | Construction |
|---|---|---|
| Categorical | Unordered groups such as regions or products | Distinct hues at similar but not identical lightness. Cap at around 7 series. |
| Sequential | Ordered magnitude such as revenue or density | One hue, stepping lightness. Light equals low by convention. |
| Diverging | Values around a meaningful centre such as change versus target | Two hues meeting at a neutral midpoint. The midpoint must be meaningful. |
Rules that prevent misreading
- Never use a rainbow palette for sequential data. It creates false boundaries where the hue changes fastest and is not perceptually ordered.
- Cap categorical series at around seven. Beyond that, group the tail into an 'other' category or change the chart type.
- Keep a series the same colour across every chart in a product. Inconsistent series colour is a reliable source of misreading.
- Reserve a dedicated colour for the highlighted or selected series, and grey the rest.
- Label directly where possible, which removes the legend lookup entirely.
- Include a pattern or texture option for print and for monochrome output.
Colour on a chart
Do
- Use a sequential ramp for magnitude and a diverging one only where a meaningful midpoint exists.
- Limit categorical palettes to what can be told apart, which is fewer than eight.
- Label series directly where space allows, and drop the legend.
- Grey the context and colour only the subject being discussed.
Do not
- Use a rainbow ramp for continuous data, which creates boundaries the data does not have.
- Let the palette assign red or green to a series that carries no such meaning.
- Rely on hue to separate lines that cross repeatedly.
In practice
- i.
Retiring rainbow scales
Scientific and analytics toolsPerceptually uniform sequential scales such as viridis replaced rainbow scales in scientific visualisation because rainbow creates artificial banding that readers interpret as structure in the data.
- ii.
Grey the context, colour the subject
DashboardsShowing all series in grey and colouring only the one being discussed makes a dense chart readable and removes the legend from the critical path.
- iii.
Twelve series, one legend
The limit of categorical colourA chart with twelve coloured lines and a legend down the side is a lookup task, not a chart. Highlighting one series and greying the rest answers the question the reader actually had.
Local chart
FND·029 · Region II · Grid D1
This entry and the entries it is stated to connect with. Each line is labelled with what the connection means.
Sources
Where a source establishes something narrower than the popular reading of it, the note says so.
- [1]
The Visual Display of Quantitative Information
E. Tufte, Graphics Press, 1983
- [2]
ColorBrewer: color advice for maps
C. Brewer, Pennsylvania State University
Well-tested categorical, sequential and diverging palettes with colour-blind-safe options.
Continue from here
Each link says what the connection is, so you can tell a principle from an alternative from a thing people mix this up with.
Applies when you are designing
Applied through
Where this shows up as a concrete interface decision.
- ChartCMP·028 · Component
- DashboardsPAT·028 · Pattern
Principles behind this
The reasoning this solution is an application of.
- Natural MappingPRIN·008 · Principle
Check your work
Review passes that test whether this was done properly.
- Dashboard UX ChecklistCHK·004 · Checklist
Short definition
The one-paragraph version, for when that is all you need.
- Colour Vision DeficiencyTERM·081 · Term
Related concept
Connected closely enough to change how you apply this.
- Use of ColorA11Y·010 · Accessibility
- Color AccessibilityFND·028 · UI foundation
- Color Theory for InterfacesFND·019 · UI foundation
- ContinuityFND·008 · UI foundation
- ContrastFND·002 · UI foundation
- HueFND·020 · UI foundation
- Semantic ColorFND·023 · UI foundation