Heatmap
Intensity across two dimensions, such as hours by weekday.
ChartHeatmap colors a grid of cells by intensity: one series per row, each point { x, y } with y the value. Use it for activity across two dimensions, such as hours by weekday or routes by status class.
ChartHeatmapUsage
import { ChartHeatmap } from "@antelopejs/interface-dms/base/chart";
static logins = ChartHeatmap({
title: "$security.logins.by_hour",
fetchUrl: "/api/security/logins/heatmap",
shadeIntensity: 0.6,
});
The route answers { series } in the shape listed under Data shapes. Wrap the chart in a ChartCard to add a headline value and a comparison.
Options
| Option | Type | Default | Description |
|---|---|---|---|
title Content | string | – | |
description Content | string | – | |
color Appearance | string | string[] | – | |
height Appearance | string | – | |
width Appearance | number | – | |
showTooltip Appearance | boolean | true | |
showLegend Appearance | boolean | true | |
legendPosition Appearance | "top" | "bottom" | – | |
shadeIntensity Appearance | number | – | |
distributed Appearance | boolean | – |
Colors
The scale follows the theme: a low value fades into the card, towards white in light mode and towards the dark card in dark mode, never a pale cell glaring on a dark page.
- One
colorshades each cell from faint to full by its value;shadeIntensity(0 to 1, default 0.6) sets how faint the lowest values go. - Several colors split the values into as many ranges, lowest first, and the legend names each range. Each range is its color laid over the card, from
1 - shadeIntensityof it for the lowest range to the full color for the highest.
Column labels
Every column has a label under the grid. When the chart is too narrow for all of them, a phone for instance, it keeps one label every few columns (00:00, 03:00, 06:00…) so they never run into each other; the tooltip still names each cell's column. Setting xAxis.tickAmount, xAxis.rotate or xAxis.hideOverlappingLabels: false turns this off and leaves the labels to those settings.
Recipes
One color per row
distributed: true scales the shading of each row on its own, so a quiet row still shows its peaks.
