Skip to main content

HeatmapCalendar

Wisej.NET 4.2.0+

Six months of daily shipments, one cell per day, shaded by volume.

The HeatmapCalendar shows one number per day across weeks and months as a grid of shaded cells: one column per week, one row per weekday, and a darker shade the higher the value. It is the "contribution calendar" made familiar by source-control sites, and it answers questions a line chart hides — which weekdays are busy, when a quiet stretch began, whether the month-end peak is real.

Reach for it when the day is the unit that matters: orders shipped, tickets closed, deployments, logins, hours booked. For a value over time where the trend is the point, use a ChartView or a Sparkline; to let the user pick a date rather than read one, use the MonthCalendar.

info

For a complete list of properties, methods, and events, see the API documentation.

Features​

Daily Records​

The calendar reads its values from DataSource: any enumerable, an IListSource such as a DataTable, or a BindingSource. Each record supplies a date and a nonnegative number, read from the properties named by DateMember and ValueMember, which default to Date and Value. The date may be a DateTime or a DateTimeOffset (or a DateOnly on .NET 6 and later), and only its calendar date is used — there is no time-zone conversion.

Records that fall on the same date are summed, and a day with no record counts as zero, so you can bind the raw rows of a log without grouping them first. A negative or non-finite value throws, and the previous data stays on screen.

this.heatmapCalendar1.DateMember = "ShippedOn";
this.heatmapCalendar1.ValueMember = "Parcels";
this.heatmapCalendar1.DataSource = shipments; // List<Shipment>

A source that raises change notifications — a BindingList<T>, an ObservableCollection<T>, or records implementing INotifyPropertyChanged — refreshes the calendar on its own. For a plain list, call RefreshData() after changing it.

Date Range​

StartDate and EndDate set the first and last day shown, both inclusive. The default is the current calendar year. Use SetDateRange(start, end) to change both ends at once, which avoids an invalid range in between; a range can span up to 3,660 days.

this.heatmapCalendar1.SetDateRange(new DateTime(2026, 4, 1), new DateTime(2026, 9, 30));

Intensity Levels and Tone​

Values are divided into Levels bands, from 2 to 10 with a default of 5, relative to the largest value in the displayed range. The first band is always zero and is drawn in the empty colour; the others are drawn in the colour chosen by Tone at increasing strength. Tone is a MeterTone: Neutral, Primary, Success (the default), Warning or Danger.

this.heatmapCalendar1.Tone = MeterTone.Primary;
this.heatmapCalendar1.Levels = 4;

Layout and Labels​

CellSize sets the square size of a day in pixels (4 to 64, default 12) and CellRadius rounds its corners. ShowMonthLabels puts abbreviated month names above the week columns, and ShowDayLabels labels the Monday, Wednesday and Friday rows; both are on by default. When the range is wider than the control, the calendar scrolls.

Each cell carries a tooltip built from ToolTipFormat, a composite format string where {0} is the date and {1} the summed value. The default is {0:d}: {1:N0}.

Events​

EventRaised whenEvent data
CellClickA day is clicked, or activated with Enter or Space.HeatmapCellEventArgs: Date, Value
CellHoverThe pointer moves onto a different day.HeatmapCellEventArgs: Date, Value
RangeSelectedThe user drags across days, or extends the selection with Shift and an arrow key.HeatmapRangeEventArgs: StartDate, EndDate

The value in the event data is the server's summed value for that day, not the one the browser displayed.

How To​

Show a Year of Activity from a Query​

Group nothing yourself: bind the rows and let the calendar sum them.

var tickets = db.Tickets
.Where(t => t.ClosedOn >= start)
.Select(t => new { Date = t.ClosedOn, Value = 1 })
.ToList();

this.heatmapCalendar1.SetDateRange(start, start.AddYears(1).AddDays(-1));
this.heatmapCalendar1.ToolTipFormat = "{0:ddd, dd MMM}: {1:N0} tickets closed";
this.heatmapCalendar1.DataSource = tickets;

Drill Down into a Day​

Handle CellClick to show the records behind the cell the user picked.

private void heatmapCalendar1_CellClick(object sender, HeatmapCellEventArgs e)
{
if (e.Value == 0)
return;

this.dataGridViewOrders.DataSource = this.orders
.Where(o => o.ShippedOn.Date == e.Date)
.ToList();

this.labelDay.Text = $"{e.Date:D}: {e.Value:N0} parcels";
}

Filter by a Selected Range​

RangeSelected returns the first and last day in chronological order, whichever way the user dragged.

private void heatmapCalendar1_RangeSelected(object sender, HeatmapRangeEventArgs e)
{
this.dataGridViewOrders.DataSource = this.orders
.Where(o => o.ShippedOn.Date >= e.StartDate && o.ShippedOn.Date <= e.EndDate)
.ToList();
}

Advanced​

JavaScript Widget​

ItemDescription
Class name"wisej.web.HeatmapCalendar"
Theme appearance"heatmapcalendar", see Themes. The primary, neutral, success, warning and danger states select the cell colour for each Tone.
Child components"scroll" is the scrollable viewport. "chart" is the HTML element that draws the cells and labels. See JavaScript.