Skip to main content
Version: 4.2

HeatmapCalendar

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.2.0.0)

Displays daily values as a contribution calendar with week columns and seven day rows.

public class HeatmapCalendar : Control

Dates retain their calendar date without time-zone conversion. Duplicate dates are summed. Missing dates have zero value. Nonnegative values are divided into Levels intensity bands, including the zero band, relative to the largest value in the displayed range. Bound lists with change notifications refresh automatically; call RefreshData for other sources.

Example:

var calendar = new HeatmapCalendar { Tone = MeterTone.Success };
calendar.SetDateRange(new DateTime(2026, 4, 1), new DateTime(2026, 9, 30));
calendar.DataSource = new[] { new { Date = new DateTime(2026, 4, 2), Value = 12d } };
calendar.CellClick += (sender, e) => MessageBox.Show($"{e.Date:d}: {e.Value}");
this.Controls.Add(calendar);

Constructors​

Instance member HeatmapCalendar()​

Initializes a calendar showing the current year with five intensity levels.

Properties​

Instance member CellRadius​

Int32: Gets or sets the cell corner radius in pixels, capped visually at half the cell size. (Default: 3)

Instance member CellSize​

Int32: Gets or sets the square cell size in pixels, from 4 through 64. (Default: 12)

Instance member DataSource​

Object: Gets or sets an enumerable source, IListSource, or BindingSource containing daily records. (Default: null)

DateMember and ValueMember default to Date and Value. Date values must be DateTime, DateTimeOffset, or DateOnly on .NET 6 and later. Null records and dates are ignored; null values count as zero. Values must be finite and nonnegative. An invalid assignment leaves the previous source intact.

Instance member DateMember​

String: Gets or sets the record property containing the calendar date. (Default: "Date")

Protected member DefaultSize​

Size: Gets the default calendar size.

Instance member EndDate​

DateTime: Gets or sets the inclusive last date. The default is the last day of the current year.

Time and DateTimeKind are discarded. Use SetDateRange to change both endpoints atomically. Ranges are limited to 3,660 days to keep rendering and interaction bounded.

Instance member Levels​

Int32: Gets or sets the number of intensity bands, including zero, from 2 through 10. (Default: 5)

Instance member ShowDayLabels​

Boolean: Gets or sets whether to display Monday, Wednesday, and Friday labels beside the rows. (Default: True)

Instance member ShowMonthLabels​

Boolean: Gets or sets whether to display abbreviated month names above week columns. (Default: True)

Instance member StartDate​

DateTime: Gets or sets the inclusive first date. The default is the first day of the current year.

Time and DateTimeKind are discarded. Use SetDateRange to change both endpoints atomically. Ranges are limited to 3,660 days to keep rendering and interaction bounded.

Instance member Tone​

MeterTone: Gets or sets the semantic color used for positive values. (Default: Success)

Instance member ToolTipFormat​

String: Gets or sets the composite tooltip format using date {0} and summed value {1}. (Default: "{0:d}: {1:N0}")

Formatting uses the current culture. Text is escaped on the client and never interpreted as HTML.

Example:

calendar.ToolTipFormat = "{0:ddd, dd MMM}: {1:N0} deployments";

Instance member ValueMember​

String: Gets or sets the record property containing the nonnegative numeric value. (Default: "Value")

Methods​

Protected member Dispose(disposing)​

Detaches source notifications when the control is disposed.

ParameterTypeDescription
disposingBooleanWhether managed resources can be released.

Protected member OnCellClick(e)​

Raises the CellClick event with authoritative server data.

ParameterTypeDescription
eHeatmapCellEventArgsEvent data.

Protected member OnCellHover(e)​

Raises the CellHover event with authoritative server data.

ParameterTypeDescription
eHeatmapCellEventArgsEvent data.

Protected member OnRangeSelected(e)​

Raises the RangeSelected event with authoritative server data.

ParameterTypeDescription
eHeatmapRangeEventArgsEvent data.

Protected member OnWebEvent(e)​

Dispatches client events to validation and processing methods.

ParameterTypeDescription
eWisejEventArgsClient event and payload.

Protected member OnWebRender(config)​

Serializes a calendar snapshot and wires its normal events unconditionally.

ParameterTypeDescription
configObjectClient configuration.

Instance member RefreshData()​

Re-reads the current source. Call after modifying sources without change notifications.

An invalid record causes an exception and preserves the last valid displayed snapshot.

Instance member SetDateRange(start, end)​

Atomically sets the inclusive date range and rebuilds daily values.

ParameterTypeDescription
startDateTimeFirst calendar date.
endDateTimeLast calendar date, at most 3,659 days after start.

Throws:

Events​

Instance member CellClick​

EventHandler<HeatmapCellEventArgs> Occurs when a day is clicked or activated with Enter or Space.

Instance member CellHover​

EventHandler<HeatmapCellEventArgs> Occurs when the pointer enters a different day.

Instance member RangeSelected​

EventHandler<HeatmapRangeEventArgs> Occurs when a date range is selected by dragging or Shift plus an arrow key.

Implements​

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejSerializableAllows an object to serialize itself.