Heatmap

A grid of colored cells shows a value across two categories at once: traffic per weekday and hour, conversion per channel and day, orders per week and weekday. Darker means more.

Traffic by weekday and hour

Each HeatmapSeries is a row, named by Name; its x values are the columns and its y values the colors. All rows share one scale: the lowest value is pale, the highest has the full color, and the legend shows the range. Hover a cell to see its value; with the chart focused, the arrow keys move between cells and rows.

Chart "Sessions per hour, last month" with 7 series. Lowest 4 at Mon 01, highest 278 at Sun 13. Sessions per hour, last month4278MonTueWedThuFriSatSun000102030405060708091011121314151617181920212223HourUse Left and Right to move between points, Up and Down to change series. Press Escape to leave.
Code
Razor
<RioChart TItem="HourCount" Title="Sessions per hour, last month" XAxis="@(new AxisOptions { Title = "Hour" })">
    @foreach (var (day, hours) in weekTraffic)
    {
        <HeatmapSeries Items="hours" Name="@day" XValue="h => h.Hour" YValue="h => h.Sessions" Format="#,0" />
    }
</RioChart>

Values in the cells

DataLabels writes each value in its cell when it fits, in light text on dark cells. Max sets the value that gets the full color; here the app's weekend rate stands out against the others.

Chart "Conversion rate per channel" with 3 series. Lowest 1.1% at Marketplace Tue, highest 4.4% at App Sat. Conversion rate per channel1.1%5.0%WebAppMarketplaceMonTueWedThuFriSatSun2.6%2.8%2.6%2.6%2.6%3.1%2.8%3.8%4.0%3.8%3.6%4.0%4.4%4.2%1.8%1.1%1.1%1.1%1.9%2.0%1.9%Use Left and Right to move between points, Up and Down to change series. Press Escape to leave.
Code
Razor
<RioChart TItem="Share" Title="Conversion rate per channel">
    @foreach (var (channel, days) in channelConversion)
    {
        <HeatmapSeries Items="days" Name="@channel" XValue="d => d.Name" YValue="d => d.Value"
                       Format="0.0'%'" DataLabels="true" Max="5" />
    }
</RioChart>

Above and below a midpoint

For changes, or values around a normal level, set Midpoint: values above it take the series color and values below it BelowColor (default --rio-negative), each side faint near the midpoint and full at its furthest value. The legend shows both sides. Here, sessions against the same hour last week: fewer in the mornings, more in the evenings.

Chart "Sessions against last week" with 5 series. Lowest -29% at Wed 08, highest +36% at Thu 21. Sessions against last week-29%0%+36%MonTueWedThuFri0809101112131415161718192021HourUse Left and Right to move between points, Up and Down to change series. Press Escape to leave.
Code
Razor
<RioChart TItem="HourCount" Title="Sessions against last week">
    @foreach (var (day, hours) in weekChange)
    {
        <HeatmapSeries Items="hours" Name="@day" XValue="h => h.Hour" YValue="h => h.Sessions"
                       Format="+0'%';-0'%';0'%'" Midpoint="0" />
    }
</RioChart>

Stepped colors

For fixed ranges, such as green, yellow and red levels, set ColorBands on the first row: each cell takes the solid color of the band its value is in, and the legend lists the bands. Later bands win where they overlap, so a first band without bounds and then Above limits leave no gaps (a value of exactly 50 is still green); values outside every band take the series color. ColorValue gives single cells a color of their own, which wins over the bands.

Chart "Server load per hour" with 3 series. Lowest 36% at web-2 08, highest 97% at web-1 14. Server load per hour< 50%50%–80%> 80%web-1web-2db-108091011121314151617181957%60%58%62%74%89%97%90%73%57%50%51%36%44%62%82%92%89%78%70%70%74%71%57%46%65%76%75%71%73%82%90%88%73%52%37%Use Left and Right to move between points, Up and Down to change series. Press Escape to leave.
Code
Razor
<RioChart TItem="Share" Title="Server load per hour">
    @foreach (var (server, hours) in serverLoad)
    {
        <HeatmapSeries Items="hours" Name="@server" XValue="h => h.Name" YValue="h => h.Value"
                       Format="0'%'" DataLabels="true" ColorBands="levels" />
    }
</RioChart>

@code {
    ColorBand[] levels =
    [
        new() { Color = "--rio-series-5" },                // green: every value...
        new() { Above = 50, Color = "--rio-series-2" },    // ...yellow above 50...
        new() { Above = 80, Color = "--rio-negative" },    // ...red above 80 (later bands win)
    ];
}

Options

OptionDefaultMeaning
NameThe row's label. Rows are drawn top to bottom in the order of the series.
XValueThe column: categories, numbers or times (cells as wide as the spacing of the data).
YValueThe value that sets the cell's color. Missing values leave the cell empty.
Color, Format, Maxfirst row'sThe hue, value format and full-color value, shared by all rows.
Midpoint, BelowColorfirst row'sColors diverge from the midpoint: above it the series color, below it BelowColor (default --rio-negative). JSON: "midpoint", "belowColor".
ColorBandsfirst row'sStepped colors: each cell takes the solid color of its value's band, and the legend lists the bands, by their Label (e.g. "High") or else their range. JSON: "colorBands".
ColorValueA cell's own solid color (a CSS color or theme token); wins over the scale and the bands. JSON: "colorField".
Legend (on the chart)topThe color scale sits above the rows, or below them with Position = LegendPosition.Bottom; Mode = LegendMode.Hide hides it.
DataLabelsfalseWrite the values in the cells (when they fit).
JSON"type": "heatmap" with "groupBy" on the row field makes one row per value, e.g. "x": "hour", "y": "sessions", "groupBy": "weekday".
An unhandled error has occurred. Reload 🗙