Three kinds of data, three kinds of palette.
Never use a rainbow for numbers. Its hues have no order the reader can see, and its bright bands create edges that are not in the data.
Every extra color is one more key the reader has to remember.
Keep a chart to about six series colors. Past that, group the smallest series into "Other", or split the chart into small multiples.
To make one point, color the series it is about and draw the rest in gray. The accent palette is built for this.
Readers learn a color once and carry it from chart to chart.
Give each series one color across every chart on a page, and keep it when the series is filtered out of one chart. Map colors to series names, not to positions in the data, so a reordered or missing series does not shift the others.
Keep green and red for good and bad. Using them as two ordinary series colors makes the reader read a judgment into them.
Marks need to stand out from the surface, and text needs more.
Check your palette against the surface it sits on, in light and dark mode. Light tints in the later steps of a palette are the first to fall short. Use emphasis="strong" for thin lines and small points.
No palette works for every reader, so color is never the only signal.
Pair every color with a second cue: a direct label on the series, a dash pattern on a line, a marker shape on a point, or a texture on an area. Check the chart with a color vision simulator in your browser's developer tools. See Accessibility.
Every chart in the kit, whatever the library, colors its series from one of three palettes.
Past a palette's length the colors start again, mixed further into the surface on each round. A seventh mono series reads as a lighter copy of the first, so plan for six series at most with mono and accent.
Because mono is the default, a chart of unordered categories reads as ranked unless you pass palette="multi".
The same three props on every chart component, and a scope for a whole region.
EChart, Recharts' ChartContainer and TanStack's Chart take palette, color and emphasis.
<ChartPalette> sets the palette for every chart inside it, and for anything else that reads chartColors.series, such as a legend you build beside the chart. It adds no box to the layout. Each chart module re-exports it.
Chart colors follow the theme's mode with no extra code.
The palettes and the chrome are CSS variables, so a chart repaints when the mode changes and inside a ThemeScope. mono and accent mix their tints into the current surface, and multi switches to its dark list. Check contrast in both modes all the same: a hue that reads on white can sink into a dark surface.
The charts block of your theme file decides the palettes for every chart.
Each value names a token (colorPrimary, amber6, colorSplit) or a CSS color. A palette takes one list for both modes, or a light and a dark list. strong holds the emphasis="strong" lists, and a palette left out there is derived one step darker.
Run tokens:build after editing it. default picks the palette a chart uses when it passes none. The Theming page covers the rest of the file.