Skip to content
IzzyBlazor

Enter all results ↑ ↓ move Esc close

Colors

Since 0.1.0-alpha.22
Series take the theme's colors, one series in color and the rest gray, shades of one color for ordered series, two colors either side of a middle, or your own.

Shades for tiers

When the series are in an order, such as plan tiers, set Palette to ChartPalette.Shades with one color, here the theme's primary. The first series is the lightest and each one after is darker.

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),
    ];
}

In dark mode the ramp turns round, so the last series is the brightest. The shades are spread over as many series as the chart has. Past about six they're hard to tell apart; for series in no order, keep the default ChartPalette.Colors.

Diverging colors

For series on either side of a middle, such as answers from disagree to agree, set Palette to ChartPalette.Diverging with the two ends' colors.

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),
    ];
}

The first series is the strongest of the first color and the last the strongest of the second. With an odd count, the middle one is gray.

ChartPalette.Of takes your own colors in order, and a series' Color still sets that one series.

One series picked out

When the chart makes a point about one series, such as one store against the rest, set Palette to ChartPalette.Emphasis with that series' index, from 0. It takes the theme palette's first color, or a color you pass, and every other series takes one gray.

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),
    ];
}

The gray keeps 3:1 contrast on the surface in both schemes, so the other series still read as data. They share it, so give every series a Name: the legend and tooltips tell them apart. Define the picked series last so its line is drawn over the grays.

Connection lost

Rejoining the server…