[data-reveal]{opacity:1!important;transform:none!important}
AntelopeJS DMS
DocumentationHeatmap

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.

Heatmap ChartHeatmap
Connecting to the DMS preview…
Connecting DMS 0.25.8 5 options set

Usage

src/pages/dashboard.ts ts
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

Options of the Heatmap block
OptionTypeDefaultDescription
title Contentstring–
description Contentstring–
color Appearancestring | string[]–
height Appearancestring–
width Appearancenumber–
showTooltip Appearancebooleantrue
showLegend Appearancebooleantrue
legendPosition Appearance"top" | "bottom"–
shadeIntensity Appearancenumber–
distributed Appearanceboolean–

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 color shades 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 - shadeIntensity of 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.

Next steps

Charts

Colors, annotations, events and the other chart types.

Chart card

Frame the chart with its headline value.