Skip to main content
One column’s values down the side and another’s across the top, each cell coloured by a metric or by a category: orders by weekday and hour, revenue by region and product, or the year each country joined each club.
The preview above is the live component gallery. Open it full size to switch between desktop and phone widths.

Options

When value names both a metric and a column, the metric wins.

Examples

Weekday by hour

With weekday and hour columns in the data, y: weekday and x: hour with a count or sum metric shows when things happen. Weekdays run from Monday and hours from 0.

Who belongs to which club

A table with one row per country and club, and a metric that takes the earliest year:
Each cell prints the year a country joined a club. The earliest years take the strongest shades, so the founding members stand out, and a cell for a club a country is not in is hatched.

Status by category

status is a text column of the same source as service and region, so each cell takes the colour of its status, with a key of statuses below.

How the numbers work

  • Every cell is the metric over the rows that have its pair of values, read in one query with the page’s period and filters. A cell never adds up other cells, so averages, distinct counts and ratios are right in each cell.
  • A cell with no rows is hatched and reads “No data”. A cell whose rows give the metric no value, or hold no category, reads “No value”.
  • Rows and columns whose values are numbers, dates, weekday names or month names keep that order. Others go by how many cells they fill, then by their own value over all their cells (the metric read for the whole row or column, not a sum of its cells), strongest shade first, then by name.
  • The scale has 3 to 7 classes between round numbers from the lowest to the highest cell. Values on both sides of zero get a diverging scale around zero.
  • An aggregate min or max whose every cell is a whole number from 1000 to 2999 reads as a year: it prints as 1958, not 1,958. With min, earlier years take the strongest shades.
  • A category heatmap counts the rows of each category in each cell. The cell takes the category with the most rows; when its rows disagree, the tooltip says how many hold another one and the build warns (HM4097). Categories are keyed most cells first, with up to eight colours; past eight, the seven largest keep theirs and the rest share a grey Other.
  • Select filters narrow the rows before the cells are formed. A category heatmap reads its column over all time; a metric heatmap reads the page’s period.

Behavior

  • Cells print their value when the metric is a number; category cells are colour only, with the category in the tooltip and in the screen reader’s cell text.
  • Hover, tap or focus a cell for a tooltip with its row, column and value. Arrow keys move between cells. On a narrow card the tooltip sits above the grid instead.
  • Picking a row name filters the page’s other blocks to that value, as on a bar list or table.
  • The grid is a table, so screen readers read each cell with its row and column names. The row names stay in view while the grid scrolls sideways. The card shows every row, and the header row stays at the top of the window, below the page’s bar on a phone, while the page scrolls past a tall grid. On a phone, column names longer than four characters turn upright.
  • Light and dark themes use the theme’s sequential, diverging and categorical colours, with the number in each cell drawn in the ink that reads on its fill.

Checks

hatchmark explain <code> explains a check and how to fix it.