Dune Charts

Chart config

Set labels and colors for each series key.

Pass a config object on the chart root. Keys must match your series dataKey values (or pie/radial nameKey values).

type DuneSeriesConfig = {
  label?: string;
  /** Base series color. Crest-to-depth bands use its hue unless `bands` is set. */
  color?: string;
  /** Optional explicit 5-stop crest-to-depth override. */
  bands?: [string, string, string, string, string];
};

Labels

Without config, legends and tooltips show the raw dataKey. Add labels for readable UI:

config={{
  melange: { label: 'Melange' },
  water: { label: 'Water' },
}}

Colors

Series colors come from config[key].color, or from the theme palette (--dune-1 through --dune-5). Custom colors still get crest-to-depth fills on area, bar, radar, and radial charts.

Custom series colorsconfig[key].color overrides the palette.

Matching keys

ChartConfig keys must match
Area, bar, line, radarEach series dataKey
Pie, radialEach row's nameKey value (for example name: 'melange')

Wrong keys do not crash the chart. Labels and custom colors simply will not apply.

On this page