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.
Code
<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.
Click a day to select its orders.
Code
<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.
Code
<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.
{
"dataset": "orders",
"title": "Orders per day",
"series": [ { "type": "calendar", "x": "placed" } ]
}