Heatmap chart reference
Contents: Use cases, Chart IDs, Minimal spec, Data, Options, Annotations, Sizing, Fixtures.
Row × column matrix — continuous or discrete color scale, in-cell values or Harvey balls. Type heatmap. Aliases: matrix.
Use cases
- A value by row and column
- Harvey-ball scoring
- Sales by weekday and hour
Chart IDs
heatmap.value: fixtureregional-monthly-performanceheatmap.harvey: fixtureharvey-quarter-stepsheatmap.bubble: fixturesurvey-journey-bubbles
Minimal spec
{
"type": "heatmap",
"data": {
"categories": [{ "id": "jan", "label": "Jan" }, { "id": "feb", "label": "Feb" }],
"series": [
{ "id": "north", "label": "North", "values": [80, 95] },
{ "id": "south", "label": "South", "values": [65, 85] }
]
},
"options": {
"unit": "orders",
"title": "Orders rise in both regions in February",
"source": "Illustrative data"
}
}Data
A cell is a number, null or a value object; see Value cell.
| Path | Type | Required | Meaning |
|---|---|---|---|
| valueKind | string | Default valueKind for all series. One of 'fraction'. | |
| categories | array | yes | Matrix columns in display order; each series supplies the values for one row. |
| categories[].id | string | yes | Category identity used to match keyed values and annotation anchors. |
| categories[].label | string | Displayed category name; defaults to the category id and supports line breaks. A date id or date without a label prints a short date such as '4 Sep'. | |
| categories[].date | string | Accepted ISO 8601 date metadata; heatmap columns remain category bands. | |
| categories[].footnote | integer | 1-based reference into options.footnotes. The number is drawn beside this category label as the reference mark, and the note it points at keeps that number; a reference to no note draws nothing and warns, and notes the engine derives print unnumbered. | |
| series | array | yes | Matrix rows, each supplying one cell value per category. |
| series[].valueKind | string | Multiply numbers by 100 into pct cells; explicit pct cells stay in percent units. One of 'fraction'. | |
| series[].id | string | yes | Series identity used by keyed options, annotations and legend entries. |
| series[].label | string | Displayed series name; defaults to the series id. The hover card names each value with it ("North: 65.8"). | |
| series[].values | (cell | { categoryId, value: cell })[] | yes | Values in category order, or keyed entries pairing a categoryId with its value. |
| series[].scenario | string | AC, PY, PL, FC (or ACT, BUD, FCST, LY for last year). Codes and aliases accept any case. Controls scenario labels and paint conventions. | |
| series[].direction | string | Declares this row's judgment for the continuous scale and PINS the whole matrix on the good/bad valence ramp (like table heat's signed flag) — declaring 'higherIsBetter' is therefore not a paint no-op on an all-positive matrix. 'lowerIsBetter' inverts the row's poles. Breaks bins go bad to good; under a breaks key every row needs the same direction (else refused). Ignored by the plain discrete ladder and harvey glyphs (warned). One of 'higherIsBetter', 'lowerIsBetter'. | |
| series[].colorRole | string | Accepted series color role; heatmap colors are resolved by the matrix scale and cell fills. One of good, bad, warn, neutral, neutralLight, highlight, total, others; series-N for step N of the theme ramp, 1-based (series-2 is color.series[1]); or status-<key> for a theme status color. A hex color goes in fill. | |
| series[].unit | string | Unit shown with this series values and used to check shared-scale compatibility. | |
| series[].format | string | Format-by-example for this series values, for example 1,234 or 1.2%. | |
| series[].sizes | array | Bubble sizes. One per category, in order: a level 1 to n with bubble.levels, else area ∝ size. | |
| series[].bases | array | Cell bases (n). One per category, in order; below minBase draws hatched. | |
| series[].states | string | null[] | Why a cell has no value. One per category, in order: suppressed, nm (not meaningful), na (not applicable) or null. A stated cell needs value null; it draws hatched and the key names its state. One of 'na', 'nm', 'suppressed' (or another value of its type). |
Options
| Path | Type | Values | Default | Meaning |
|---|---|---|---|---|
| scale | string | 'continuous', 'discrete' | 'continuous' | Continuous color interpolation by default, or a discrete color ladder. |
| variant | string | 'value', 'harvey', 'bubble' | 'value' | Value labels fit as a whole row and print the same text at every size: a value with no room is hidden, never shortened; authored labels and valid pins retain precedence. Harvey glyphs suppress values and take ratings 0 to 4 only; any other value is refused. 'bubble': one circle per cell, color = value, area = series sizes; values print where they fit. |
| cap | object | Where the continuous scale saturates, as table heat's cap: a value at or past it paints full strength, measured from zero. Without it the good/bad scale is symmetric, full at the largest |value|, and the magnitude ramp spans the data. The discrete ladder ignores it (cap-ignored), and harvey glyphs ignore it (option-ignored). | ||
| cap.pct | number | Cap in points when every cell is a percent. Example: 20 saturates at ±20%. | ||
| cap.abs | number | Cap in source units for other values. | ||
| breaks | array | Bin edges. Ascending, for scale 'discrete', e.g. [0, 30, 50, 100]; an edge value takes the upper bin. A series direction paints bins bad to good. | ||
| bubble | object | Bubble glyph. Its keys stand above the matrix; legend 'none' drops them. | ||
| bubble.levels | array | Size levels. Names smallest first, e.g. ['Low', 'Medium', 'High']; sizes hold levels 1 to n. | ||
| bubble.sizeLabel | string | Size key title. | ||
| bubble.colorLabel | string | Color key title. | ||
| bubble.track | boolean | Row track. A line with an arrow through each row; implies ordered columns. Default false. | ||
| columnOverrides | object | Settings per generated column. Ids: label, each data.categories id. | ||
| columnOverrides.*.width | number | Track width in px. It beats the width the type would pick. | ||
| columnOverrides.*.align | string | 'left', 'right', 'center' | Alignment of the column: its cell text and, unless headAlign is set, its head. Bars keep starting at the panel origin. | |
| columnOverrides.*.headAlign | string | 'left', 'right', 'center' | Head alignment; defaults to align. | |
| columnOverrides.*.label | string | Head text. | ||
| minBase | number | Low-base threshold. Cells whose series bases entry is below it draw hatched, with a note. | ||
| missing | string | 'hatch', 'blank' | How a cell with no value is drawn. 'hatch' (the default) stripes the cell and names it in the key. 'blank' draws no fill and no stripe; the same key entry or note still says that a blank cell is no data. A blank cell keeps its grid line and dash, so it does not read as the palest value. A low base (bases and minBase) stays hatched. |
Plus the shared options. This type does not accept labelPosition, valueAxis, rounding. This type ignores animate, debug, rowLabels, categoryAxis, categoryLabels, secondaryAxis, topN, bandFraction, valueAxis.show, valueAxis.gridlines with an option-ignored warning.
Annotations
An annotation anchor is a category or item id string, or an object with categoryId plus optional seriesId, segmentId and edge (start, end, total); pointId addresses a scatter point. Category anchors, including from/to, take category ids, not category labels.
| Kind | Purpose | Required | Anchors | Optional fields | Notes |
|---|---|---|---|---|---|
| cagr | Draws a growth arrow between two anchored points and computes the compound annual growth rate from their values and ISO-date span. | from: AnchorRef (optional); to: AnchorRef (optional) | suffix: string, default 'p.a.'. Text after the rate. period: boolean. Print the period before the rate from the anchors' category labels, '2014–2019: +5.8% p.a.'. Default true when the chart carries two or more CAGRs, so nested brackets are told apart by their text, false otherwise. An arrow's ends show its span, so an arrow prints the rate alone unless period is true. shape: bracket | arrow, default bracket. arrow draws one straight arrow over the marks with the rate in an oval on it, lifted until it clears them. Where no straight line clears the chart, the span is too short for the oval, a stack's inner layer is the anchor or the chart lays comparisons out itself, it draws the bracket and warns cagr-arrow-no-room. | Omitted endpoints span the first to the last category, or the first to the last total on a waterfall. Resolved endpoints need a positive date interval from ISO dates or year-bearing labels and a positive start value; an end of zero reads -100%, and a start at or below zero or a negative end omits the rate and warns cagr-undefined. On a continuous time axis the years are the exact span between the two readings. An anchor on one series of several (seriesId, or a category of an unstacked line, which reads the first drawn series; on a stack a category reads the stack total) names that series in the label, "Product B +10.1% p.a.", and the arm runs from that series' segment or point. In text, ${value} prints the rate with its suffix, so "CAGR 2014–2019: ${value}" keeps the computed number. | |
| diff | Draws a level-difference arrow between two anchors and computes either percent change or their signed value difference. | from, to | from: AnchorRef; to: AnchorRef | mode: relative | absolute | reversed | both, default relative. relative prints the percent change from 'from' to 'to', reversed the change from 'to' to 'from', absolute the value difference, both the value difference with the percent change beside it. | Mode defaults to relative. Relative and reversed changes need a nonzero base; negative bases use its absolute magnitude and emit a warning. Absolute mode reports the raw value difference. A hidden label removes its arm. |
| callout | Places authored free text at an anchored data element, routing a leader when displaced and honoring the preferred side. | at, text | at: AnchorRef | preferSide: left | right | above | below. Side the solver tries first; the label keeps a leader when it moves. headline: string. A bold first line over the text, which then prints in plain type; ${value} in it prints the anchored value from the data. Example: "headline": "${value}", "text": "Peak in handheld-loom demand" prints 153 in bold over the words. arrow: boolean, default false. An arrow from the text to the anchored point, in the arrow standard of theme marks.arrow: the text stands far enough out for a 24 px shaft, level with the point right or left of it, or over or under it, where there is room. With no such seat it draws without the arrow and warns callout-arrow-no-room. Not with icon or status. Example: "arrow": true. | |
| note | Places authored text at an anchored data element through collision avoidance, with an optional icon or status chip. | at, text | at: AnchorRef | ||
| delta | Computes the signed difference between an anchored value and another anchor or literal, then places a collision-managed label at the first anchor. | at, vs | at: AnchorRef; vs: AnchorRef | number | mode: absolute | relative | both, default absolute. absolute prints at minus vs, relative the percent change from vs to at, both the two as '+149 (+36%)'. relative and both need a nonzero vs. | |
| abs | Reads the anchored data value and places its formatted absolute value in a collision-managed label. | at | at: AnchorRef | ||
| text | Places authored text at a point through the label solver: on the point, or above, below, right or left of it. The text prints as written. | at, text | at: AnchorRef | { categoryId, value } | A point is an anchor or { categoryId, value } with value in axis units. A value outside the plot, a chart with no value scale or an anchor that does not resolve warns bad-anchor and draws nothing; the axis does not grow. The text prints as written, ${value} included. It takes id and priority, and no other field. | |
| line | Draws a straight line between two points or from a text annotation, in the ink and rule width of a bracket; a stretch that would cross text is cut. | from, to | from: AnchorRef | { categoryId, value } | { annotationId }; to: AnchorRef | { categoryId, value } | { annotationId } | dashed: boolean, default false. Draws the line in the dash of a reference line. | A point is an anchor or { categoryId, value } with value in axis units. A value outside the plot, a chart with no value scale or an anchor that does not resolve warns bad-anchor and draws nothing; the axis does not grow. An end { annotationId } names a text annotation: the line starts or ends at the nearest edge of that text, at every size, and is not drawn when the text is not. A { categoryId, value } end stands on the category's center. A stretch that would cross text is cut and warns draw-crosses-text. It takes dashed and id, and no other field. |
| arrow | Draws a straight arrow between two points or from a text annotation to a point, in the theme arrow look (marks.arrow); a stretch that would cross text is cut. | from, to | from: AnchorRef | { categoryId, value } | { annotationId }; to: AnchorRef | { categoryId, value } | { annotationId } | dashed: boolean, default false. Draws the shaft in the dash of a reference line. | A point is an anchor or { categoryId, value } with value in axis units. A value outside the plot, a chart with no value scale or an anchor that does not resolve warns bad-anchor and draws nothing; the axis does not grow. An end { annotationId } names a text annotation: the arrow starts or ends at the nearest edge of that text, at every size, and is not drawn when the text is not. A { categoryId, value } end stands on the category's center. A stretch that would cross text is cut and warns draw-crosses-text. It takes dashed and id, and no other field. |
| box | Draws an unfilled box with two points as opposite corners, wrapping whole category bands, in the ink and rule width of a bracket; text inside the box stays free. | from, to | from: AnchorRef | { categoryId, value }; to: AnchorRef | { categoryId, value } | dashed: boolean, default false. Draws the edges in the dash of a reference line. | A point is an anchor or { categoryId, value } with value in axis units. A value outside the plot, a chart with no value scale or an anchor that does not resolve warns bad-anchor and draws nothing; the axis does not grow. from and to are opposite corners, the box has no fill, and text inside it stays free. A { categoryId, value } corner spans that category's whole band, so the box wraps whole bars, values and markers; from and to on one category wrap that category. A stretch that would cross text is cut and warns draw-crosses-text. It takes dashed and id, and no other field. |
Sizing
Floor 280 × 28 px; fit content.
Below the floor a render is refused with size-below-floor and the pixels it needs. measure returns the natural and comfortable size for a given spec; see Sizing in the manual.
Fixtures
| ID | Kind | Use case |
|---|---|---|
| harvey-quarter-steps | example | Harvey balls from empty to full in theme highlight |
| capability-matrix | example | Capability assessment matrix, 6 capabilities × 5 business units, Harvey balls |
| regional-monthly-performance | example | Performance heatmap: 12 months × 8 regions, continuous scale, negatives red-side |
| single-row | torture | Torture: single row, discrete ladder |
| all-equal | torture | Torture: all-equal values (degenerate continuous domain) |
| dense-20x12 | torture | Torture: 20×12 dense grid with narrow cells and readable rows |
| missing-cells | torture | Torture: missing cells render background + dash, means skip nulls |
| missing-cells-blank | example | A cell with no value stays blank, and the key still names it |
| regional-monthly-full | torture | Signed monthly values in full mode |
| regional-monthly-compact | torture | Signed monthly values in compact mode |
| regional-monthly-colorblind | torture | Signed monthly values in the colorblind-safe good/bad pair |
| regional-monthly-capped | example | Signed monthly values on a scale capped at ±4 |
| period-comparisons | example | Annual growth and differences between named matrix cells |
| torture-long-labels | torture | Torture: long names at a generous size read whole, never cut |
| series-formats | torture | Rows have distinct formats |
| cell-states | example | A cell with a state is named in the key as suppressed, not meaningful or not applicable |
| measure-already-names-unit | torture | The measure names the unit once |
| survey-journey-bubbles | example | Survey bubble matrix: 6 segments × 12 touchpoints, importance as size, binned satisfaction as color, two low-base cells |
| survey-journey-long-names | example | Survey bubble matrix with long touchpoint names: the matrix turns instead of rotating or thinning the names |
| survey-journey-track | example | Survey bubble matrix with a row track: the touchpoints are ordered journey steps |
| column-widths | example | A wider first column, aligned values and a renamed head |