Skip to content
TrademarkTrademark
Docs
Data

Colors and styling

Updated: November 12, 2026
View on GitHub

Charts draw from their own palette, the --data-* tokens, tuned so neighbouring series stay apart in light and dark. You rarely need to pick colours: leave color off and the chart assigns them. When a colour carries meaning (a brand, a status, "this year"), set it per series.

Automatic colours

Without color, series take hues spread around the palette, as far apart as the count allows:

Series
Colours
1blue
2blue, orange
3blue, orange, cyan
4blue, orange, green, magenta
5 or morespaced evenly across the 13 hues

Pie slices follow the same rule, counted by slice.

Series colours

series[].color takes four kinds of value:

  • A palette hue, such as "blue", "emerald" or "contrast": the palette's colour. It follows the theme and the chart's mode.
  • Your theme, "brand" or "accent": the theme's brand or accent colour, at the same step as the palette hues, so it sits with them in light and dark.
  • A token, such as "danger-medium" or "--my-colour": that token. A tone with a weight is that role's text colour.
  • Any CSS colour, such as "#6E56CF" or "oklch(70% 0.15 160)": exactly that, in light and dark alike.

The palette hues are blue, indigo, violet, magenta, pink, red, orange, yellow, moss, green, emerald, aqua, cyan, plus gray and contrast (white in dark, black in light) for a reference series.

A single-series chart in "brand" is the usual way to make a dashboard feel like the product. Write "brand", not "brand-strong": a tone with a weight is that role's text colour, which is white in dark and black in light.

Weekly active users
Weekly active users: data
weekUsers
W11,840
W22,120
W32,010
W42,460
W52,790
W63,120
W1W2W3W4W5W6

Prefer palette hues and tokens to raw CSS colours. A hex value looks the same in light and dark, and on one of them it usually loses contrast.

Modes

A mode decides what the palette hues mean. Set it for the app in dataStyle.mode (see Setup), or for one chart with the data-viz-style prop.

  • categorical (default): distinct hues for things that have no order, such as channels, teams or products.
  • divergent: a run from red through yellow to cyan, for values on either side of a midpoint, such as change against last year or sentiment.
  • sequential: steps of the brand colour, for ordered things where more is more, such as age bands or price tiers.
categorical
categorical: data
qabcd
Q11218914
Q215161217
divergent
divergent: data
qabcd
Q11218914
Q215161217
sequential
sequential: data
qabcd
Q11218914
Q215161217

A mode works by redefining the palette hues inside the chart. In divergent, blue is a red and cyan is the far end of the run. So in divergent and sequential charts, leave color off and let the series take their places in order; a hue name you set means "this step of the run", not that colour. Tokens and CSS colours ignore the mode.

Variants

variant sets how areas and bars are filled. Set it for the app in dataStyle.variant, or per chart.

gradient (default)
gradient (default): data
mab
Jan126
Feb159
Mar1312
Apr1911
May2215
flat
flat: data
mab
Jan126
Feb159
Mar1312
Apr1911
May2215
outline
outline: data
mab
Jan126
Feb159
Mar1312
Apr1911
May2215

outline draws only the lines and bar edges, which keeps overlapping series readable; flat fills without the fade.

The card

Every chart is a Column, a card with a border and a radius, and takes the Flex props: spacing, background, border, radius, shadow and so on.

  • No card: border="transparent" (or border={false}) and no background, to set a chart inside your own Card or tile.
  • Height: charts are dataStyle.height tall, 24rem by default. Set height as a string, height="16rem". A number is on the spacing token scale, so height={16} is 1rem and flattens the chart to a line. The title and description take their room from that height; the plot gets the rest.
  • Width: charts fill their container. Put them in a Grid or a Row to lay several out; they resize with it.
Edit this page on GitHub