Chart series

Eight tokens — series-1 … series-8 — and they do one job: say which series a mark belongs to. They are the identity channel of a chart and they are not available for anything else.

Why the semantic tokens could not do it

The system has six hues with meaning attached: accent is a link, success is a gain, warning is a caution, danger is a loss, neutral is the absence of a charge. A four-series chart drawn from that set has to borrow from it, and two of the five are alarm colours.

That borrow is not a cosmetic compromise. Drawing a series called Issues in danger red tells the reader the line is bad news; drawing Receipts in success green tells them it is good. Neither is something the data said. The chart ends up asserting a judgement the query never made, and the reader has no way to know the colour is arbitrary.

So the identity channel needs hues that mean nothing — which is exactly what these eight are.

The order is the safety property

Slots are assigned in sequence and never cycled. A chart with three series uses 1, 2, 3 — not 1, 4, 7 because they look nicer together, and not 1, 2, 3 re-shuffled per chart.

SlotHueLightDark
1blue#2a78d6#3987e5
2orange#eb6834#d95926
3aqua#0ba975#199e70
4yellow#c78702#c98500
5magenta#dd719a#d55181
6green#008300#008300
7violet#4a3aa7#9085e9
8red#e34948#e66767

The ordering is measured, not chosen. Adjacent pairs are separated under simulated protanopia and deuteranopia (Machado–Oliveira–Fernandes 2009 at severity 1.0), scored as Euclidean distance in OKLab ×100:

  • worst adjacent CVD ΔE 9.2 light / 8.4 dark (target ≥ 8)
  • worst adjacent normal-vision ΔE 17.8 light / 19.3 dark (floor ≥ 15)
  • every slot inside the per-mode lightness band, every slot over the chroma floor
  • every slot at least 3:1 against the card (surface) in both themes, a required check in test-tokens.mjs

Re-stepping one slot by eye breaks the set. The values are a validated instance; if a slot has to move, the whole ordering is re-measured, not patched.

Dark is selected, not flipped. The dark column is the same eight hues stepped for a dark surface and validated against it as its own set. An algorithmic lighten of the light column does not land inside the dark band.

Light slots 3, 4 and 5 were darkened for 2.0

Until 2.0, series-3 (2.82:1), series-4 (2.17:1) and series-5 (2.69:1) sat under the 3:1 a non-text mark needs on a light card, on the argument that pushing them darker would collapse the colour-vision separation. Measured, it does not: each was darkened in OKLCH at its own hue, only as far as 3:1 (and its chroma pulled into the sRGB gamut where the darker colour needed it), and the set re-measured as a whole.

Slot1.x light2.0 lighton the card
3#1baf7a#0ba9753.02:1
4#eda100#c787023.05:1
5#e87ba4#dd719a3.04:1

Worst adjacent CVD ΔE went from 9.1 to 9.2 (protanopia, 3–4), and worst adjacent normal-vision ΔE from 19.6 to 17.8 (4–5, yellow beside magenta, now nearer in lightness), still over the floor of 15. The dark column did not move. (This page said 22.9 for the light set's worst normal-vision ΔE in 1.x; that was the 3–4 pair. Over every adjacent pair it was 19.6, at 4–5.)

The one thing you must ship with them

3:1 makes a mark findable against the card; it does not make eight hues nameable. So identity is never carried by colour alone:

  • a legend is always present from two series up, and
  • at four series or fewer, each line is also labelled directly at its end.

A chart that drops the direct labels has broken the contract these tokens were validated under. It is not a nicety.

Series count

Eight is the ceiling, and it is a real one. A ninth series is never a generated hue — fold the tail into an Other, facet into small multiples, or ask a narrower question.

For charts where any two marks can end up side by side — scatter, bubble, choropleth, small multiples — only the first three slots are validated. Past three in those forms, facet; do not reach for slot four.

Do not

  • Do not key a slot on a business value. state === 'OVERDUE' ? series-8 : series-1 is a palette keyed on domain meaning — the same defect as a role name in a conditional, and harder to see because it looks like design. The series' position picks the slot; nothing else may.
  • Do not use a series token for UI chrome. No borders, no badges, no icons, no text. If it is not a mark in a plot, it is not one of these.
  • Do not use a status colour as "series 5". success / warning / danger stay reserved, and when a chart genuinely encodes state it ships an icon and a label with the colour, never the colour alone.
  • Do not re-colour survivors when a filter changes the series count. Colour follows the entity, not its rank — a series keeps its slot when its neighbours are hidden, or the chart repaints itself into a different story.

From the package repo: edit this page on GitHub.

Was this page helpful?