Heatmap
Visualize data density across two dimensions with the Heatmap component.
A heatmap represents data as a matrix where individual values are represented as colors. Heatmaps can help you discover trends and understand complex datasets, for example, website traffic by page and time.

Buckets
| Prop | Required | Takes | What it does |
|---|---|---|---|
measure | Yes | One measure | Sets the value, and so the color, of each cell. |
rows | No | One attribute | Creates one row per attribute value. |
columns | No | One attribute | Creates one column per attribute value. |
filters | No | Filters | Limits the data the heatmap shows. |
Sorting
Without sortBy, the heatmap sorts the data by the rows attribute in descending order. You can pass sortBy to sort the data differently.
Configuration
Pass these options in the config prop. See Chart configuration for details.
| Option | What it changes |
|---|---|
colors, colorPalette, colorMapping | Base color of the cells. The heatmap takes the first color, or the color that colorMapping assigns to the measure, splits the values into seven equal ranges, and gives each range a shade of that color. |
legend | Whether the legend shows and where. The legend shows the value range of each shade. |
dataLabels | visible shows or hides the cell values. style: "backplate" adds a background behind them. |
xaxis, yaxis | The X axis (columns) and the Y axis (rows). visible, labelsEnabled, rotation, and name set how the axis, its labels, and its name show. |
zoomInsight | true lets you zoom in along the X axis and pan while holding Shift. |
separators | Thousands and decimal separators in the number format. |
The following example shows the config structure with sample values:
import type { IChartConfig } from "@gooddata/sdk-ui-charts";
const config: IChartConfig = {
xaxis: {
visible: true,
labelsEnabled: true,
rotation: "auto"
},
yaxis: {
visible: true,
labelsEnabled: true,
rotation: "auto"
},
legend: {
enabled: true,
position: "top"
},
dataLabels: {
visible: "auto"
},
separators: {
thousand: ",",
decimal: "."
}
};
Limits
- A heatmap renders up to 10,000 cells. With more, the chart shows an error and
onErrorreceives aDataTooLargeToDisplaySdkError. Filter the data to fit. - With 150 or more cells, the heatmap hides the data labels, even if
dataLabels.visibleistrue.
Structure
import "@gooddata/sdk-ui-charts/styles/css/main.css";
import { Heatmap } from "@gooddata/sdk-ui-charts";
<Heatmap
measure={<measure>}
rows={<attribute>}
columns={<attribute>}
config={<chart-config>}
…
/>
Example
import "@gooddata/sdk-ui-charts/styles/css/main.css";
import { Heatmap } from "@gooddata/sdk-ui-charts";
import * as Md from "./catalog.js";
<div style={{ height: 300 }}>
<Heatmap
measure={Md.$TotalSales}
rows={Md.LocationState}
columns={Md.MenuCategory}
/>
</div>
Props
| Prop | Type | Required | Description | Inherited from |
|---|---|---|---|---|
measure | AttributeMeasureOrPlaceholder | Yes | Specify measure whose values will be charted on the heatmap. | IHeatmapBucketProps |
backend | IAnalyticalBackend | No | Analytical backend, from which the chart will obtain data to visualize If you do not specify instance of analytical backend using this prop, then you MUST have BackendProvider up in the component tree. | IBucketChartProps |
columns | AttributeOrPlaceholder | No | Specify attribute, whose values will be used to create columns in the heatmap. | IHeatmapBucketProps |
config | IChartConfig | No | Configure chart’s behavior and appearance. | ICommonChartProps |
drillableItems | ExplicitDrill[] | No | Configure drillability; e.g. which parts of the visualization can be interacted with. | IVisualizationProps |
ErrorComponent | ComponentType<IErrorProps> | No | React component to display in the event when there is an error with either obtaining the data from backend or with the data itself. | IVisualizationProps |
execConfig | IExecutionConfig | No | Execution configuration, will provide the execution with necessary config before initiating execution. | ICommonChartProps |
exportTitle | string | No | Set title to use for exported files. | IVisualizationProps |
filters | NullableFiltersOrPlaceholders | No | Specify filters to apply on the data to chart. | IHeatmapBucketProps |
height | number | No | Set height of the chart (in pixels). | ICommonChartProps |
LoadingComponent | ComponentType<ILoadingProps> | No | React component to display while loading data from the backend. | IVisualizationProps |
locale | string | No | Set Locale for visualization localization. | IVisualizationProps |
onDataView | OnDataView | No | (Alpha) Called when the visualization loads a DataView, i.e. it receives data from the backend. | IVisualizationCallbacks |
onDrill | OnFiredDrillEvent | No | Called when user triggers a drill on a visualization. | IVisualizationCallbacks |
onError | OnError | No | Called when an error occurs while loading data for the visualization. | IVisualizationCallbacks |
onExportReady | OnExportReady | No | Called when the visualization is ready to be exported. | IVisualizationCallbacks |
onLegendReady | OnLegendReady | No | Called when legend is rendered. | IChartCallbacks |
onLoadingChanged | OnLoadingChanged | No | Called when loading status of the visualization changes - vis starts or stops loading | IVisualizationCallbacks |
placeholdersResolutionContext | any | No | Resolution context for composed placeholders. | IHeatmapBucketProps |
rows | AttributeOrPlaceholder | No | Specify attribute, whose values will be used to create rows in the heatmap. | IHeatmapBucketProps |
sortBy | SortsOrPlaceholders | No | Specify how to sort the data to chart. | IHeatmapBucketProps |
width | number | No | Set width of the chart (in pixels). | ICommonChartProps |
workspace | string | No | Identifier of analytical workspace, from which the chart will obtain data to visualize. If you do not specify workspace identifier, then you MUST have WorkspaceProvider up in the component tree. | IBucketChartProps |
Related
Display data in a flexible, multi-dimensional table with the PivotTableNext component.
Show correlation between two measures with the ScatterPlot component.
Display hierarchical data as nested rectangles with the Treemap component.
Configure chart appearance, axes, legends, colors, and data labels.
Shared behavior of GoodData.UI visual components — responsive sizing, the style and data props model, and the visualization lifecycle callbacks.