Calendar heatmap

A calendar heatmap shows a value for every day over months or years, such as orders, visits or activity. Each day is a square in its week, colored by its value, so weekly rhythms, seasons and quiet days show at a glance.

A year of orders

CalendarSeries draws a square per day: weeks are columns and weekdays are rows, with month names above. XValue is a date or time and YValue the day's value; the color gets stronger with the value, on the same scale as the heatmap. Days without a value are gray. The week starts on the chart culture's first day: Monday in most of Europe, Sunday in the United States.

Orders per day, 2026. Calendar heatmap with 360 days: lowest 0 at Sat 1/24/2026, highest 67 at Mon 8/24/2026. Orders per day, 2026067MonWedFriJanFebMarAprMayJunJulAugSepOctNovDecUse Left and Right to move between points. Press Escape to leave.
Code
Razor
<RioChart Items="orders" Title="Orders per day, 2026">
    <CalendarSeries Name="Orders" XValue="r => r.Time" YValue="r => r.Value" />
</RioChart>

@code {
    record Reading(DateTime Time, double? Value); // one per day
}

From raw events

Items on the same day add up, so a list of orders gives the calendar directly; Aggregate combines them another way (Aggregate.Average for an average order). Without a YValue each day counts its items. Days are midnight to midnight in the chart's TimeZone when it is set. Up to a year of data is one block from the first day to the last. With Selection on, clicking a day selects its items.

Orders, spring. Calendar heatmap with 76 days: lowest 1 at Sun 3/1/2026, highest 5 at Thu 5/28/2026. Orders, spring15SunMonTueWedThuFriSatMarAprMayUse Left and Right to move between points. Press Escape to leave.

Click a day to select its orders.

Code
Razor
<RioChart Items="orders" Title="Orders, spring" Selection="ChartSelectionMode.Points" @bind-SelectedItems="picked">
    <CalendarSeries Name="Orders" XValue="o => o.Placed" />   @* no YValue: counts the orders per day *@
</RioChart>

@code {
    IReadOnlyCollection<Order> picked = [];
    record Order(DateTime Placed, double Amount);
}

Above and below a value

Midpoint splits the colors at a value, as for heatmaps: days above it take the series color, days below it BelowColor, each stronger the further from the midpoint. More than a year of data is one block per year, each labeled with its year. Max fixes the value that gets the full color.

Daily mean temperature. Calendar heatmap with 730 days: lowest -3.3 °C at Sun 1/26/2025, highest 21.2 °C at Sun 7/12/2026. Daily mean temperature-3.3 °C10.0 °C21.2 °C2025MonWedFriJanFebMarAprMayJunJulAugSepOctNovDec2026MonWedFriJanFebMarAprMayJunJulAugSepOctNovDecUse Left and Right to move between points. Press Escape to leave.
Code
Razor
<RioChart Items="temperatures" Title="Daily mean temperature">
    <CalendarSeries Name="Mean" XValue="r => r.Time" YValue="r => r.Value"
                    Midpoint="10" Color="--rio-negative" BelowColor="--rio-series-1" Format="0.0 °C" />
</RioChart>

JSON definitions

In a JSON definition, "type": "calendar" with a date or time "x" field. Rows on the same day add up, or combine with "aggregate"; without "y" each day counts its rows.

JSON
{
  "dataset": "orders",
  "title": "Orders per day",
  "series": [ { "type": "calendar", "x": "placed" } ]
}
An unhandled error has occurred. Reload 🗙