Charts need more colours than an interface does, and they use them for a different job. The
data-visualization.* tokens are a separate group for that job: they help a reader tell series apart
and read an amount from a colour. No EDS component binds them, and they are not meant for buttons,
banners or other interface elements. Token names below use Figma's dotted form;
Getting Started shows the CSS and
TypeScript forms.
Place charts on background.surface. Every contrast figure on this page is measured against it, in
both colour schemes.
Choose a group
The kind of data decides the group:
| Data | Group | Tokens | Example |
|---|---|---|---|
| Categories with no order between them | Categorical | data-visualization.cat.1 to cat.10, each with steps 1 to 5 | Production per field, incidents per region |
| Ordered values that run from low to high | Sequential | data-visualization.seq.1 to seq.7 | Utilisation in a heatmap, depth on a map |
| Values that run in two directions from a midpoint | Diverging | data-visualization.div.1 to div.9 | Above and below plan, change since last year |
Use one group per chart. When a chart mixes groups, the reader has to guess whether a colour stands for a category or for an amount.
Ten hues, five steps each. Use the hues to separate series; use the steps within one hue when a single series needs shading.
For magnitude, where one end means more than the other.
For values either side of a midpoint, such as above and below a target.
Categorical colours
There are ten categorical hues, cat.1 to cat.10, with five steps each. Use the hues to tell series
apart. Use the steps within one hue when a single series needs more than one shade, for example a
forecast next to the measured values, or a selected bar among the others.
What the step numbers mean
Compare the light and dark columns in the table below. In light, step 1 is a pale tint and step 5 is almost black. In dark it is the other way round: step 1 is a deep shade and step 5 is pale. In both schemes, step 1 is the quietest step, sitting closest to the colour of the page, and step 5 is the one that stands out most.
A step number therefore describes how strongly a colour stands out from the background. When this page says "use step 1 for a tint behind the plot area", you get a tint that stays in the background in both schemes, and "use step 5 for the one mark that must stand out" gives a mark that stands out in both.
| Step | Light | Dark | What it means in both |
|---|---|---|---|
| 1 | Closest to the background. Barely stands out. | ||
| 2 | Quiet. | ||
| 3 | The base colour of each hue. The same in both schemes. | ||
| 4 | Stronger. | ||
| 5 | Furthest from the background. Stands out most. |
Each cell shows the ten hues, cat.1 to cat.10, at that step, on the surface of its own colour scheme.
Step 3 is the base colour of each hue and looks the same in both schemes. The other steps swap places around it: the pale tint that is step 1 in light is step 5 in dark. The interface colours work the same way, as the palette explains.
Because step 3 looks the same in both schemes, it does not stand out equally in both. In row 3 of the
table, the dark teal of cat.1 (the first swatch) is strong on the light surface and almost
disappears on the dark one, and the yellow of cat.2 (the second swatch) does the opposite.
Contrast lists the hues this affects.
Which step to use
| Step | Use it for | Why |
|---|---|---|
| 1 | Decorative areas that carry no meaning, such as a hover background or a tint behind the plot area | Closest to the background, and below 3:1 for every hue in both schemes |
| 2 | Bands that carry meaning, such as a target range or an uncertainty band, always with a label; filled marks that should step back, such as the other bars when one is selected. Not for lines or points | Reaches 3:1 for only 2 of 10 hues in light and 4 of 10 in dark, so it needs a label |
| 3 | The default colour for bars, areas and other filled marks | The anchor of the hue, the same in both schemes |
| 4 | Lines, points and a series that should stand out | Reaches 3:1 for every hue in both schemes |
| 5 | The one line or mark that has to stand out most, such as a target series | Furthest from the background in both schemes. Not for several series at once: at step 5 most of the first five hues look alike |
Where a hue is too weak in a scheme at the step it is used for, make its values available as text as well: direct labels, a tooltip or a data table. Contrast lists those hues.
Series order and how many series
Assign hues in token order, starting at cat.1, and keep each series on the same hue when a filter
changes what the chart shows.
Colour alone tells up to five series apart. cat.1 to cat.5 at step 3 stay distinguishable with
normal colour vision and with the three common forms of colour blindness (protanopia, deuteranopia
and tritanopia). Step 3 has the same values in both schemes, so this is true in light and dark.
From six series, add a second cue. Pairs start to look alike from the sixth hue: pink cat.4 and
purple cat.6 are close even with full colour vision, and at seven and eight hues, cat.1 and
cat.7 (dark teal and red) and cat.4 and cat.8 (pink and green-teal) merge for readers with red
or green colour blindness. No set of eight hues can be told apart by colour alone. A chart with six or
more series can still use all ten hues if each series also has one of these:
- A direct label at the end of the line or on the bar, instead of only a legend
- A marker shape or a line dash
- A place in an "Other" group, for the smallest series
These results come from simulating colour blindness with the model by Machado, Oliveira and Fernandes (2009) and with the check in the EDS palette generator, and counting a pair as distinct only when it passes both.
Sequential and diverging colours
Sequential and diverging ramps follow the same rule as the categorical steps: the distance from the
background carries the meaning. In both schemes seq.1 sits closest to the background and stands for
the lowest values, and seq.7 sits furthest from it and stands for the highest. In the diverging ramp
the midpoint div.5 sits closest to the background and stands for no difference, and the two ends,
the blue div.1 and the orange div.9, sit furthest from it.
These two ramps are generated separately for each scheme, so the dark values are not the light values in reverse order.
The low end of the sequential ramp and the middle of the diverging ramp are close to invisible on the
surface, especially in dark, where seq.1 and div.4 to div.6 score APCA Lc 0. That is intended,
because low values and values near the midpoint should recede in a heatmap or a map. The contrast goal
for chart marks therefore does not apply to cells in a sequential or diverging fill. A reader still has
to tell "low", "zero" and "no data" apart:
- Give cells at the low end or the midpoint a thin border, so that their shape stays visible.
- Show missing data with its own pattern or label, never with the low-end colour.
- Make exact values available another way: labels, a tooltip or a table.
Light and dark
Most data-visualisation values change between schemes: 56 of the 66 values are different, and only the categorical step 3 values stay the same. A chart keeps its meaning when the scheme changes, because each step keeps its position relative to the background, but it does not keep its exact colours. Check every chart in both schemes, and use the tokens rather than the hex values of one scheme.
Contrast
Chart marks are graphical objects, so WCAG 2.1 asks for a contrast of at least 3:1 against the colours next to them when a reader needs the mark to understand the chart (success criterion 1.4.11). EDS designs for APCA and treats WCAG as the minimum, as it does for text (see the colour introduction). For chart marks:
| Mark | Minimum | Goal |
|---|---|---|
| Bars, areas and other filled marks | WCAG 3:1 | APCA Lc 30 |
| Lines and small markers | WCAG 3:1 | APCA Lc 45 |
Measured against background.surface:
| Categorical step | Light: reaches 3:1 | Light: APCA Lc | Dark: reaches 3:1 | Dark: APCA Lc |
|---|---|---|---|---|
| 1 | 0 of 10 hues | 10 to 35 | 0 of 10 hues | 0 to 10 |
| 2 | 2 of 10 hues | 18 to 69 | 4 of 10 hues | 0 to 38 |
| 3 | 6 of 10 hues | 26 to 94 | 9 of 10 hues | 9 to 77 |
| 4 | 10 of 10 hues | 64 to 99 | 10 of 10 hues | 33 to 86 |
| 5 | 10 of 10 hues | 93 to 102 | 10 of 10 hues | 68 to 94 |
These hues miss the minimum or the goal at the step they are used for. Make their values available as text as well, with direct labels, a tooltip or a data table:
| Use | Light | Dark |
|---|---|---|
| Step 3 fills, below 3:1 | cat.2, cat.3, cat.8, cat.10 | cat.1 |
| Step 3 fills, above 3:1 but below Lc 30 | none | cat.6 (Lc 22), cat.7 (Lc 20) |
| Step 4 lines, below Lc 45 | none | cat.1 (Lc 33), cat.7 (Lc 43) |
In dark the two measures disagree more than in light. cat.7.3 reaches 3.13:1 but only Lc 20, so it
passes the minimum while still looking faint on the dark surface.
Text in charts
Use the text.* tokens for axis labels, data labels and legends. The data-visualization.* values
are tuned for marks and do not reach the contrast text needs on every step. When a data label sits on
a coloured bar, check its contrast against the bar rather than against the surface.
Colour is not the only cue
Some readers cannot tell certain hues apart, and screenshots and printouts can lose colour. Pair colour with a second cue: direct labels, marker shapes, line dashes, or a table with the same data. The accessibility foundation covers the general rule.
Solid colours only
Use the data-visualisation colours as they are, without opacity. A see-through mark has no fixed contrast, because its colour depends on whatever is behind it, so it cannot be checked against the goals above. The rest of the EDS colour scale follows the same rule. Instead of transparency:
- For a target range or an uncertainty band, use step 2 of the same hue, drawn behind the data, with a label.
- To fade the other bars or areas when one is selected, switch them to step 2. Lines are not faded: show or hide them instead.
- For overlapping areas, use stacked areas, lines or small multiples.
- For dense scatter plots, use smaller or hollow markers, or group the points into bins.
Examples
The three charts below use only the tokens and rules on this page. The field names are Equinor production fields, but every number is random example data with no connection to the production of these fields. Switch the site between light and dark to see each chart in both schemes.
Several wells in one line chart
Gas rate, water rate and cumulative gas for six wells in three fields. Select the wells to show with the checkboxes. Each measure has its own panel and its own scale, and the panels share one time axis. Putting the three measures on one plot would need three y-axes, and lines on different scales cannot be compared with each other.
Each well keeps its hue (cat.1 to cat.6, step 4) in every panel, and keeps it when wells are
selected or cleared. Each well also has its own marker shape and a label at the end of its line.
Up to five wells, colour alone tells them apart. Select the sixth, and the shapes and labels do that
job. The end labels also cover cat.1 in dark, where its step 4 is below the goal for lines. Move
the pointer over the chart, or focus it and use the arrow keys, to read all selected wells at one
date.
Colour alone tells up to five wells apart. From six, the marker shapes and the labels at the end of each line tell them apart.
Random example data. The numbers have no connection to the production of these fields or any other.
Show the data as a table
| Year | Well 1 gas (kSm³/d) | Well 1 water (m³/d) | Well 1 cumulative gas, end of year (GSm³) | Well 2 gas (kSm³/d) | Well 2 water (m³/d) | Well 2 cumulative gas, end of year (GSm³) | Well 3 gas (kSm³/d) | Well 3 water (m³/d) | Well 3 cumulative gas, end of year (GSm³) | Well 4 gas (kSm³/d) | Well 4 water (m³/d) | Well 4 cumulative gas, end of year (GSm³) | Well 5 gas (kSm³/d) | Well 5 water (m³/d) | Well 5 cumulative gas, end of year (GSm³) | Well 6 gas (kSm³/d) | Well 6 water (m³/d) | Well 6 cumulative gas, end of year (GSm³) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 | 91 | 11 | 0.053 | 73 | 30 | 0.061 | 57 | 6 | 0.070 | 42 | 20 | 0.080 | 34 | 39 | 0.092 | 19 | 3 | 0.102 |
| 2005 | 88 | 13 | 0.084 | 70 | 34 | 0.086 | 54 | 7 | 0.090 | 43 | 23 | 0.096 | 28 | 40 | 0.102 | 19 | 3 | 0.109 |
| 2006 | 83 | 15 | 0.114 | 69 | 37 | 0.111 | 49 | 7 | 0.108 | 38 | 25 | 0.109 | 28 | 42 | 0.113 | 13 | 4 | 0.114 |
| 2007 | 80 | 18 | 0.143 | 63 | 42 | 0.134 | 45 | 9 | 0.124 | 34 | 27 | 0.122 | 23 | 43 | 0.121 | 14 | 3 | 0.119 |
| 2008 | 80 | 20 | 0.172 | 62 | 44 | 0.156 | 44 | 9 | 0.140 | 31 | 30 | 0.133 | 21 | 44 | 0.129 | 9 | 5 | 0.122 |
| 2009 | 76 | 21 | 0.199 | 55 | 49 | 0.176 | 46 | 11 | 0.156 | 32 | 34 | 0.145 | 21 | 45 | 0.136 | 9 | 5 | 0.125 |
Production by field in a stacked bar chart
Four fields per month, in step 3 with a 2px gap between the segments. Some of these hues are weak in
one of the schemes (cat.2 and cat.3 in light, cat.1 in dark), so the tooltip and the data table give
every value as text. Select a field to bring it forward, and the other fields fade to
step 2. The plan line uses a text
colour, because it is a reference and not data.
Random example data. The numbers have no connection to the production of these fields or any other.
Show the data as a table
| Month | Johan Sverdrup | Troll | Oseberg | Gullfaks | Total |
|---|---|---|---|---|---|
| Jan | 519 | 350 | 249 | 151 | 1,269 |
| Feb | 493 | 362 | 231 | 153 | 1,239 |
| Mar | 541 | 352 | 226 | 156 | 1,275 |
| Apr | 504 | 324 | 212 | 140 | 1,180 |
| May | 463 | 316 | 187 | 128 | 1,094 |
| Jun | 439 | 259 | 193 | 107 | 998 |
| Jul | 185 | 241 | 165 | 118 | 709 |
| Aug | 377 | 232 | 160 | 116 | 885 |
| Sep | 383 | 284 | 170 | 110 | 947 |
| Oct | 372 | 259 | 192 | 121 | 944 |
| Nov | 426 | 318 | 195 | 124 | 1,063 |
| Dec | 503 | 355 | 224 | 132 | 1,214 |
Share by field in a donut chart
The same four fields, in the same hues as the bar chart. The slices run from the largest to the smallest, clockwise from the top, with a 2px gap between them, and each slice is labelled with its share. Use a donut only when the message is how one whole divides into a few parts, five at most. To compare amounts, a bar chart is easier to read.
Random example data. The numbers have no connection to the production of these fields or any other.
Show the data as a table
| Field | kSm³/d | Share |
|---|---|---|
| Johan Sverdrup | 434 | 41% |
| Troll | 304 | 28% |
| Oseberg | 200 | 19% |
| Gullfaks | 130 | 12% |
Do's and Don'ts
- Choose the group from the data before choosing any colours.
- Keep a series on the same hue when a filter changes the chart.
- Add a second cue as soon as a chart has six or more series.
- Check every chart in light and dark.
- Use
data-visualization.*for interface elements such as buttons, banners or status badges. Use the semantic tone tokens for those. - Use step 1 for anything that carries meaning, or step 1 or 2 for a line or a point.
- Use
data-visualization.*for text. - Make the colours see-through with opacity.
Where to go next
- Data visualisation covers dashboards, layout and choosing a chart type.
- The palette shows how these values sit next to the main colour scale.
- Reference lists every value in both schemes.