Skip to content
IzzyBlazor

Enter all results ↑ ↓ move Esc close

Chart colors

Charts, gauges and the scheduler color their series from the theme's chart palette. The default, Brand, starts at your brand color and keeps neighboring series apart for color-blind readers, in light and dark. You can pick another palette for the app, for part of a page or for one chart.

The palettes

Each palette has eight colors in a fixed order. A chart's first series takes the first color, its second the second, and so on. The order is part of the palette: neighbors are chosen to stay apart, so a chart never skips or shuffles them.

PaletteColorsUse it for
Brand
The default. Starts at your brand color, then Contrast's colors.
Contrast
The same in every app; every color stays visible on the surface.
OkabeIto
The widely used color-blind-safe set: seven colors, then gray. Familiar in science and reports.
Calm
Muted colors for dashboards people read all day.

Brand, the default, puts the brand color first, so a chart of one series is your app's color. The rest are Contrast's colors without the one nearest the brand, in the order that keeps neighbors furthest apart. It follows Brand on the IzzyTheme, a preset's brand, and a ThemeScope that sets a brand of its own. The IzzyTheme works the palette out: a brand set only in CSS, with a data-ib-brand attribute or your own --ib-color-primary, keeps Contrast. So does a brand with no color of its own, such as ink or a gray: a chart draws target ticks and reference lines in the text color, and they'd be lost on a series of the same color.

Contrast has eight colors of one lightness, each at least 3:1 on the surface in both schemes, so thin lines and small markers stay visible. It is the same in every app.

With Brand or Contrast, a chart with exactly two, three or four series gets a set chosen for that count, where every pair stays apart, not only neighbors. Brand's sets start at the brand color; a brand that leaves no such set of four (teal and green) takes the four that come closest. The count is the series the chart defines, so hiding one from the legend never repaints the others.

Okabe-Ito and Calm have some lighter colors under 3:1 in light mode. Keep a legend, labels or a table view with them, so no series depends on its color alone.

Choose the app's palette

Set ChartPalette on the IzzyTheme in the head:

Components/App.razor
<IzzyTheme ChartPalette="ThemeChartPalette.OkabeIto" />

For part of a page, set it on a ThemeScope. For one chart whatever the theme's, set the chart's Palette to ChartPalette.Contrast, ChartPalette.OkabeIto or ChartPalette.Calm.

razor
<ThemeScope ChartPalette="ThemeChartPalette.Calm">
    <Chart ...>...</Chart>
</ThemeScope>

<Chart Items="_sales" Palette="ChartPalette.Contrast">...</Chart>

Palettes for one chart

Distinct colors say which series is which. When the series mean something more, set the chart's Palette to one of these.

One series picked out

ChartPalette.Emphasis(index) colors one series and grays the rest, for a chart about one of them, such as one store against the others. The gray keeps 3:1 on the surface, so the others still read as data.

Static

Preview

Orders by store, 2026
  • Porto
  • Madrid
  • Seville
  • Valencia
  • Lisbon
Arrow keys move between values; Escape hides the tooltip.

Code

Emphasis.razor
@* Monthly orders at five stores: Lisbon, the one the page is about, in color, the others gray for context. *@
<Chart Items="_months" Argument="m => m.Month" Title="Orders by store, 2026" Palette="ChartPalette.Emphasis(4)">
    <ChartLineSeries Value="m => m.Porto" Name="Porto" />
    <ChartLineSeries Value="m => m.Madrid" Name="Madrid" />
    <ChartLineSeries Value="m => m.Seville" Name="Seville" />
    <ChartLineSeries Value="m => m.Valencia" Name="Valencia" />
    <ChartLineSeries Value="m => m.Lisbon" Name="Lisbon" />
</Chart>

@code {
    private record StoreMonth(string Month, int Porto, int Madrid, int Seville, int Valencia, int Lisbon);

    private readonly StoreMonth[] _months =
    [
        new("Jan", 412, 520, 365, 298, 340),
        new("Feb", 398, 505, 372, 305, 362),
        new("Mar", 430, 548, 380, 312, 401),
        new("Apr", 441, 532, 391, 320, 448),
        new("May", 455, 561, 384, 331, 497),
        new("Jun", 448, 570, 402, 328, 552),
    ];
}

Series in an order

ChartPalette.Shades(color) runs from light to dark for series in an order, such as plan tiers. Past about six, shades are hard to tell apart.

Static

Preview

Subscribers by plan, 2026
  • Starter
  • Pro
  • Team
  • Enterprise
Arrow keys move between values; Escape hides the tooltip.

Code

Shades.razor
@* Paying subscribers each month by plan, tiers in order: shades of the primary color. *@
<Chart Items="_months" Argument="m => m.Month" Title="Subscribers by plan, 2026"
       Stacking="ChartStacking.Normal" Palette="ChartPalette.Shades(Color.Primary)">
    <ChartBarSeries Value="m => m.Starter" />
    <ChartBarSeries Value="m => m.Pro" />
    <ChartBarSeries Value="m => m.Team" />
    <ChartBarSeries Value="m => m.Enterprise" />
</Chart>

@code {
    private record MonthPlans(string Month, int Starter, int Pro, int Team, int Enterprise);

    private readonly MonthPlans[] _months =
    [
        new("Jan", 1_020, 610, 220, 38),
        new("Feb", 1_065, 642, 231, 40),
        new("Mar", 1_110, 688, 249, 43),
        new("Apr", 1_142, 715, 262, 45),
        new("May", 1_198, 760, 280, 49),
        new("Jun", 1_236, 798, 301, 52),
    ];
}

Two sides of a middle

ChartPalette.Diverging(low, high) meets at a gray middle, for answers from disagree to agree or a change below and above zero.

Static

Preview

Customer survey, Q3
  • Strongly disagree
  • Disagree
  • Neutral
  • Agree
  • Strongly agree
Arrow keys move between values; Escape hides the tooltip.

Code

Diverging.razor
@* A customer survey: each statement's answers as shares, from disagree to agree. *@
<Chart Items="_answers" Argument="a => a.Statement" Title="Customer survey, Q3"
       Stacking="ChartStacking.Percent" Orientation="Orientation.Horizontal"
       Palette="ChartPalette.Diverging(Color.Danger, Color.Success)">
    <ChartBarSeries Value="a => a.StronglyDisagree" Name="Strongly disagree" />
    <ChartBarSeries Value="a => a.Disagree" />
    <ChartBarSeries Value="a => a.Neutral" />
    <ChartBarSeries Value="a => a.Agree" />
    <ChartBarSeries Value="a => a.StronglyAgree" Name="Strongly agree" />
</Chart>

@code {
    private record Answers(string Statement, int StronglyDisagree, int Disagree, int Neutral, int Agree, int StronglyAgree);

    private readonly Answers[] _answers =
    [
        new("Setup was easy", 12, 31, 58, 164, 135),
        new("The docs answered my question", 21, 47, 82, 151, 99),
        new("Support replied quickly", 9, 18, 61, 140, 172),
        new("I'd recommend it", 15, 26, 70, 128, 161),
    ];
}

Your own colors

ChartPalette.Of(...) takes your colors in order, for dashboards where each entity always has the same color, such as a product line. A series' Color still sets that one series.

Your own palette for the app

Charts read --ib-chart-1 to --ib-chart-8, and --ib-chart-of2-1 to --ib-chart-of4-4 for the two-, three- and four-series sets. Set them in your stylesheet, each as a light-dark() pair:

css
:root {
  --ib-chart-1: light-dark(#1f6fd1, #4a92f0);
  --ib-chart-2: light-dark(#b8520f, #e07a3a);
  /* … to --ib-chart-8, and --ib-chart-of2-1 to --ib-chart-of4-4 */
}

Check your colors before you ship them. Neighbors should differ for color-blind readers as well as everyone else, and each color should be at least 3:1 on the surface in both schemes.

How the palettes are checked

Every build checks the palettes in tokens.css. Distance is measured in OKLab, and color blindness is simulated with the Machado, Oliveira and Fernandes (2009) model. Neighbors must stay at least 8 apart for protanopia and deuteranopia, and 15 apart for typical vision. The two-, three- and four-series sets check every pair. Contrast and its sets must keep 3:1 on the surface, as must the Emphasis gray. The Brand palette is checked the same way for each built-in brand, and worked out with the same measure for a hex brand.

Good practice

  • Keep a legend for two or more series, and label up to four series directly, so color is never the only cue.
  • Past eight series, fold the smallest into "Other" or split the chart into small multiples; never add colors.
  • Keep text in text colors. Values and labels beside a series stay in the text color; the mark carries the color.
  • Leave status colors (success, warning, danger) for status, not for a fourth series.

Next steps

Connection lost

Rejoining the server…