--- title: "Perspective - Heatmap" description: "The Heatmap component visualizes magnitude across two categorical or temporal dimensions simultaneously." --- # Perspective - Heatmap > The Heatmap component visualizes magnitude across two categorical or temporal dimensions simultaneously. ![The default display for a Heatmap component.](imgs/perspective-heatmap-default.png) **Component Palette Icon:** ![The Heatmap component palette icon within the Perspective Components panel.](imgs/perspective-heatmap-icon.png) The Heatmap component visualizes magnitude across two categorical or temporal dimensions simultaneously. Each cell in the grid represents the intersection of an x and y category, colored by value. Common use cases include overall equipment effectiveness by hour and day-of-week, alarm frequency by equipment and shift, process variable intensity maps, production quality matrices, and more. The Heatmap component has two pre-configured variants: * **Grid**: The magnitude across two categorical dimensions, communicated by a stepped scale of colors with clear boundaries. This chart can be configured into multiple operational zones, including normal, caution, and alarm. * **Gradient**: The magnitude across two categorical dimensions, communicated by a continuous interpolated scale of colors. This chart is best for data with no natural breakpoints. ## Properties | Name | Description | Property Type | | ---- | ----------- | ------------- | | data | The dataset powering the chart. Each row is one cell. The `xField` and `yField` categories represent the cells and `valueKey` represents the magnitude. Options include:**xField**: Row key read for the x-axis category. Value is string.**yField**: Row key read for the y-axis category. Value is string.**valueField**: Row key read for the cell value. Value is string. | array | | xAxis | Configures the x-axis category. See [xAxis Properties](#xaxis-properties) for more object properties. | object | | yAxis | Configures the y-axis category. See [yAxis Properties](#yaxis-properties) for more object properties. | object | | visualMap | Maps each cell's value to a color. See [visualMap Properties](#visualmap-properties) for more object properties. | object | | dataLabels | Configures the value label rendered inside each cell. Options include:**visible**: Shows the value label inside each cell. Default is true for the Grid variant, and false for Gradient variant. Value is boolean.**fontSize**: Font size of the cell label text. Value is numeric.**color**: Cell label color. This color is fixed to each cell. Leave empty for automatic per-cell contrast. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See [Color Selector](appendix\reference-pages\color-selector-reference\color-selector-reference.mdx).**format**: The label text template. Tokens serve as placeholders that will be replaced with live data during runtime. Tokens include `{x}` for the column category, `{y}` for the row category, and `{value}` for the cell value. Value is string.**elementStyle**: Text style for a label rendered onto a chart canvas, including typography, alignment, optional box styling, and shadow. | object | | title | Configures the chart title and subtitle, including options for text, styling, and layout customization. See [title Properties](#title-properties) for more object properties. | object | | tooltip | The tooltip shown on hover. See [tooltip Properties](#tooltip-properties) for more object properties. | object | | appearance | Configures chart-level visuals. See [appearance Properties](#appearance-properties) for more object properties. | object | | style | Styles defined within the Project to be applied to this component. | object | ### xAxis Properties | Name | Description | Property Type | | ---- | ----------- | ------------- | | visible | Shows the x-axis when true. Default is true. | boolean | | title | The name of the x-axis, shown alongside tick labels. Options include:**visible**: Shows the axis title when true. Default is true. Value is boolean.**text**: Axis title text. Leave empty for no title. Value is string.**color**: Color of the axis title text. Leave empty to use the theme label color. Takes precedence over `elementStyle.color`. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See [Color Selector](appendix\reference-pages\color-selector-reference\color-selector-reference.mdx).**fontSize**: Font size of the axis title text. Takes precedence over `elementStyle.fontSize`. Value is numeric.**position**: Determines whether the title sits along the `start`, `middle`, or `end` of the axis. Default is middle. Value is string.**gap**: Distance in pixels between the axis title and axis line. Value is numeric.**rotation**: The axis title rotation in degrees. Value is numeric.**elementStyle**: Text style for a label rendered onto a chart canvas, including typography, alignment, optional box styling, and shadow. | object | | position | Determines whether data renders along the `top` or `bottom` of the x-axis. Default is `bottom`. | string | | labels | Configures the tick value label text. Options include:**visible**: Shows the tick value label text when true. Default is true. Value is boolean.**rotation**: Rotation of the tick labels in degrees. Value is numeric.**width**: Max width in pixels before overflow handling occurs. To avoid long categories crowding the plot, leave this value as empty to cap long labels automatically. Value is numeric.**overflow**: How labels wider than the maximum allowed width are handled. Can be `none`, `truncate`, `break`, and `breakAll`. Value is string.**color**: Color of the x-axis label text. Takes precedence over `elementStyle.color` when both are set. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See [Color Selector](appendix\reference-pages\color-selector-reference\color-selector-reference.mdx).**fontSize**: Font size of the x-axis label text. Takes precedence over `elementStyle.fontSize` when both are set.**format**: Optional number pattern for numeric categories. For example, `0,0.0`. Ignored by text properties. Value is numeric.**elementStyle**: Text style for a label rendered onto a chart canvas, including typography, alignment, optional box styling, and shadow. | object | ### yAxis Properties | Name | Description | Property Type | | ---- | ----------- | ------------- | | visible | Shows the y-axis when true. Default is true. | boolean | | title | The name of the y-axis, shown alongside tick labels. Options include:**visible**: Shows the axis title when true. Default is true. Value is boolean.**text**: Axis title text. Leave empty for no title. Value is string.**color**: Color of the axis title text. Leave empty to use the theme label color. Takes precedence over `elementStyle.color`. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See [Color Selector](appendix\reference-pages\color-selector-reference\color-selector-reference.mdx).**fontSize**: Font size of the axis title text. Takes precedence over `elementStyle.fontSize`. Value is numeric.**position**: Determines whether the title sits along the `start`, `middle`, or `end` of the axis. Default is middle. Value is string.**gap**: Distance in pixels between the axis title and axis line. Value is numeric.**rotation**: The axis title rotation in degrees. Value is numeric.**elementStyle**: Text style for a label rendered onto a chart canvas, including typography, alignment, optional box styling, and shadow. | object | | position | Determines whether data renders to the `right` or `left` of the y-axis. Default is `left`. | string | | labels | Configures the tick value label text. Options include:**visible**: Shows the tick value label text when true. Default is true. Value is boolean.**rotation**: Rotation of the tick labels in degrees. Value is numeric.**width**: Max width in pixels before overflow handling occurs. To avoid long categories crowding the plot, leave this value as empty to cap long labels automatically. Value is numeric.**overflow**: Configures how labels wider than the maximum allowed width are handled. Can be `none`, `truncate`, `break`, and `breakAll`. Value is string.**color**: Color of the y-axis label text. Takes precedence over `elementStyle.color` when both are set. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See [Color Selector](appendix\reference-pages\color-selector-reference\color-selector-reference.mdx).**fontSize**: Font size of the y-axis label text. Takes precedence over `elementStyle.fontSize` when both are set.**format**: Optional number pattern for numeric categories. For example, `0,0.0`. Ignored by text properties. Value is numeric.**elementStyle**: Text style for a label rendered onto a chart canvas, including typography, alignment, optional box styling, and shadow. | object | ### visualMap Properties | Name | Description | Property Type | | ---- | ----------- | ------------- | | mode | The differentiator between the Heatmap variants. Setting the mode to either `grid` or `gradient` will swap between one of the two variants. | string | | emptyColor | The fill color for empty or non-numeric cells. Leave empty to draw no cell. Note that the grid background will still show through the cell when not drawn. | color | | pieces | A list of ordered value ranges and their colors. Only applies to the Grid variant. List order matters, as the last entry will treat `max` as inclusive. Leave empty to use the theme default color ramp.**min**: The inclusive lower boundary value. Leave empty for an open lower range. Value is numeric.**max**: The exclusive upper boundary value. Leave empty for an open upper range. If this is the last object within the `pieces` array, defaults to inclusive. Value is numeric.**color**: Color of the cell when the value falls between the specified `min` and `max` range. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See [Color Selector](appendix\reference-pages\color-selector-reference\color-selector-reference.mdx).**label**: Label text for this range in the color-scale legend. Value is string. | array | | invert | Reverses the color mapping when true. Only applies to the Gradient variant. Default is false. | boolean | | min | Minimum value of the color scale. Only applies to the Gradient variant. Can be a number, or leave empty to fit the provided data. | numeric | | max | Maximum value of the color scale. Only applies to the Gradient variant. Can be a number, or leave empty to fit the provided data. | numeric | | gradient | Colors used for the Gradient variant's continuous color ramp. Only applies to the Gradient variant. Color ramp includes endpoint colors plus optional interior stops. Colors can be chosen from the color wheel, color palette, or entered as RGB or HSL values. See [Color Selector](appendix\reference-pages\color-selector-reference\color-selector-reference.mdx). Options include:**colorLow**: Color at the low end of the range.**colorHigh**: Color at the high end of the value range.**stops**: Optional interior color stops, enabling diverging ramps. Options include:**percent**: Position along the ramp, from 0 - 100. Value is numeric.**color**: The color at this stop. | object | | legend | The color-scale legend shown alongside the grid. The Grid variant renders individual color band swatches, while the Gradient variant renders a continuous color bar. Options include:**visible**: Shows the color-scale legend when true. Default is true. Value is boolean.**position**: The placement of the color-scale legend within the chart. Value is string.**orientation**: Layout direction of the color-scale legend. Leave empty to follow the default placement. `horizontal` places the legend along the top and bottom edges of the chart. `vertical` places it along the sides and corners of the chart. Value is string.**interactive**: If true, hovering over a color band in the legend filters the chart to highlight all corresponding cells within that band. If false, filtering is disabled. Can also be set to `single` to isolate one band at a time. Value is string or boolean.**width**: Thickness of the continuous color bar in pixels. Only applicable for the Gradient variant. Value is numeric.**length**: Length of the continuous color bar in pixels. Only applicable for the Gradient variant. Leave empty to use the default bar length. Value is numeric.**wrapLabels**: If true, wraps wide color band labels across multiple lines. This ensures that the labels stay beside the grid instead of overlapping cells. If false, keeps each label on one line. Use `legend.gap` to reserve the extra width. Value is boolean.**gap**: The extra space in pixels between the legend and the plot. The more this value increases, the more the grid and axes are pushed away from the legend when labels crowd eachother. Value is numeric.**color**: Color of the legend text. Takes precedence over `elementStyle.color` when both are set. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See [Color Selector](appendix\reference-pages\color-selector-reference\color-selector-reference.mdx).**fontSize**: Font size of the legend text. Takes precedence over `elementStyle.fontSize` when both are set.**elementStyle**: Text style for a label rendered onto a chart canvas, including typography, alignment, optional box styling, and shadow. | object | ### title Properties | Name | Description | Property Type | | ---- | ----------- | ------------- | | visible | Shows the title of the chart when true. | boolean | | text | The main title text. | string | | color | Color of the main title text. Takes precedence over `elementStyle.color` when both are set. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See [Color Selector](appendix\reference-pages\color-selector-reference\color-selector-reference.mdx). | color | | fontSize | The font size of the main title text. Takes precedence over `elementStyle.fontSize` when both are set. | numeric | | subtitle | Configures the subtitle displayed below the main title. Options include:**text**: Subtitle text. Value is string.**color**: Color of the subtitle text. Takes precedence over `elementStyle.color` when both are set. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See [Color Selector](appendix\reference-pages\color-selector-reference\color-selector-reference.mdx).**fontSize**: Font size of the subtitle text. Takes precedence over `elementStyle.fontSize` when both are set. Value is numeric.**elementStyle**: Text style for a label rendered onto a chart canvas, including typography, alignment, optional box styling, and shadow. | object | | position | The position of the title within the chart. | string | | gap | The gap in pixels between the main title and subtitle. | numeric | | elementStyle | Text style for a label rendered onto a chart canvas, including typography, alignment, optional box styling, and shadow. | object | ### tooltip Properties | Name | Description | Property Type | | ---- | ----------- | ------------- | | enabled | Shows the tooltip on hover when true. | boolean | | formatter | Sets the tooltip display format. Options include: **type**: Sets the format type as either `value` or `template`. `value` reformats the value inside the tooltip, while `template` replaces the default tooltip format entirely with a customized template. Value is string.**value**: The value to apply to the cell, keeping the default tooltip text. Only applicable when `formatter.type` is set to `value`. Value is string.**template**: Your own tooltip text, replacing the default layout. Applicable tokens include `{x}` for the column category, `{y}` for the row category, `{value}` for the cell value, and `{marker}` as an indicator dot. Leave empty to display the default tooltip. Only applicable when `formatter.type` is set to `template`. Value is string. | object | ### appearance Properties | Name | Description | Property Type | | ---- | ----------- | ------------- | | borderWidth | Width of each cell's border in pixels. Set to `0` to remove cell borders. | numeric | | borderColor | Cell border color. Leave empty to use the default theme. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See [Color Selector](appendix\reference-pages\color-selector-reference\color-selector-reference.mdx). | color | | borderRadius | Corner radius of each cell in pixels. | numeric | | backgroundColor | Background fill for the entire chart component. Leave empty for transparent. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See [Color Selector](appendix\reference-pages\color-selector-reference\color-selector-reference.mdx). | color | | highlight | Configures cell styling when hovered over or highlighted by the legend. Options include:**itemStyle**: Visual style for a shape element rendered onto a chart canvas. Options include:**shadowColor**: The color of the drop-shadow in multi-line text format. Default is `rgba(0, 0, 0, 0.5)`. Value is string.**shadowBlur**: The drop-shadow blur radius in pixels. Value is numeric.**lightness**: The shift in brightness applied to a highlighted cell's fill on a `-1` to `1` scale. Positive values lighten while negative values darken. The default value `0` leaves the fill unchanged, so the drop shadow alone carries the highlight. Decimal values are accepted. Ignored when `itemStyle.color` is set. Value is numeric.**dimOpacity**: The opacity other cells fade to when a single cell is hovered over or a legend band is highlighted. Opacity is set on a `0` to `1` scale, with decimal values accepted. Lower values dim, while a full `1` disables dimming. Opacity fading honors the chart's animation settings. Default is `0.25`. Value is numeric.**dimTransitionDuration**: The duration in milliseconds of the dim fade-in/out animation when hovering over a cell or legend band. Default is `180` milliseconds. Only applies when chart animation is enabled. Value is numeric. | object | | animation | Configures chart-level entry and transition animation. Options include:**enabled**: Enables chart animation on render and update when true. Default is true. Value is boolean.**entry**: Initial animation applied when the chart first renders.**duration**: Entry animation duration in milliseconds. Value is numeric.**easing**: Easing function applied to the entry animation. Value is string.**delay**: Delay before the entry animation starts in milliseconds. Value is numeric.**transition**: Update animation applied when chart data changes.**duration**: Transition animation duration in milliseconds.**easing**: Easing function applied to the transition animation.**delay**: Delay before the transition animation starts in milliseconds. | object | ## Component Scripts and Events The Heatmap component also has Component Events associated with it. See the [Heatmap - Line Scripting](perspective-heatmap-scripting.md) page for more information. ## Examples ### Grid Example ![An example of a Grid Heatmap component displaying the sample data below.](imgs/examples-grid-heatmap.png) This example showcases color-coded values across the same days at different times using a Grid variant. The sample data used in this example is listed below in JSON format. ```JSON Title="Grid Sample Data" [ { "props": { "data": [ { "hour": "00:00", "day": "Mon", "value": 87 }, { "hour": "00:00", "day": "Tue", "value": 91 }, { "hour": "00:00", "day": "Wed", "value": 78 }, { "hour": "01:00", "day": "Mon", "value": 83 }, { "hour": "01:00", "day": "Tue", "value": 95 }, { "hour": "01:00", "day": "Wed", "value": 64 } ], "xField": "hour", "yField": "day", "xAxis": { "title": { "text": "Hour" }, "labels": { "fontSize": 12 } }, "yAxis": { "title": { "text": "Day" }, "labels": { "fontSize": 12 } }, "visualMap": { "emptyColor": "#E6E6E6", "pieces": [ { "min": 85, "max": "", "color": "#2DB87A", "label": "World Class" }, { "min": 65, "max": 85, "color": "#E0A020", "label": "Acceptable" }, { "min": "", "max": 65, "color": "#D84C3F", "label": "Needs Improvement" } ], "legend": { "orientation": "vertical", "wrapLabels": false, "gap": 80, "fontSize": 12 } }, "appearance": { "borderWidth": 1, "borderColor": "#FFFFFF" } } } ] ``` ### Gradient Example ![An example of a Gradient Heatmap component displaying the sample data below.](imgs/examples-gradient-heatmap.png) This example showcases how color-coded statuses could display across different zones on a factory floor using a Gradient variant. The sample data used in this example is listed below in JSON format. ```JSON Title="Gradient Sample Data" [ { "props": { "data": [ { "value": 42.3, "x": "Zone A", "y": "Sensor 1" }, { "x": "Zone A", "y": "Sensor 2", "value": 67.8 }, { "x": "Zone B", "y": "Sensor 1", "value": 88.1 }, { "x": "Zone B", "y": "Sensor 2", "value": 31.4 } ], "xAxis": { "labels": { "fontSize": 12 } }, "yAxis": { "labels": { "fontSize": 12 } }, "visualMap": { "mode": "gradient", "emptyColor": "#E6E6E6", "min": 0, "max": 100, "gradient": { "colorLow": "#1A5FAD", "colorHigh": "#E8590C" }, "legend": { "orientation": "vertical" } }, "appearance": { "borderWidth": 1, "borderColor": "#FFFFFF" } } } ] ```