A Heatmap Series displays data in a matrix format, using colours to denote the magnitude of the values.
 Simple Heatmap Copy Link  
To create a Heatmap Series, use the heatmap series type.
{
    series: [
        {
            type: 'heatmap',
            xKey: 'month',
            yKey: 'year',
            colorKey: 'temperature',
        },
    ],
}
In this configuration:
xKeyis set to 'month', which is the category for the X Axis.yKeyis set to 'year', which is the category for the Y Axis.colorKeyis set to 'temperature', which supplies numerical values for the Colour Scale.
 Customisation Copy Link  
 Colour Range Copy Link  
Series items colours can be customised via the colorRange configuration array.
{
    series: [
        {
            type: 'heatmap',
            xKey: 'month',
            yKey: 'year',
            colorKey: 'temperature',
            colorRange: ['#43a2ca', '#a8ddb5', '#f0f9e8'],
        },
    ],
}
The colorRange array must contain 2 or more values.
 Labels Copy Link  
If label.enabled is set to true, the labels will show the numeric value from colorKey.
colorKey: 'temperature',
label: {
    enabled: true,
    formatter: ({ datum, colorKey }) => {
        const value = datum[colorKey];
        return `${value.toFixed(0)}°C`;
    },
}
A label formatter can be used to customise the label text.
 Gradient Legend Copy Link  
The Gradient Legend aids in matching the colour coding of the heatmap series to the underlying values, and is enabled by default.
series: [
    {
        type: 'heatmap',
        xKey: 'month',
        yKey: 'year',
        colorKey: 'temperature',
    },
],
gradientLegend: {
    enabled: true,
}
 Position Copy Link  
By default the Gradient Legend is placed at the bottom of the chart. Use the position option to change this.
{
    gradientLegend: {
        position: 'right',
    },
}
When the position is left or right, the Gradient Legend displays the values in descending order. Use reverseOrder to change this.
 Size Copy Link  
{
    gradientLegend: {
        gradient: {
            thickness: 50,
            preferredLength: 400,
        },
    },
}
In the above configuration:
thicknesscontrols the thickness (or width) of the gradient bar.preferredLengthsets the initial length of the gradient bar. It is only preferred, as the Gradient Legend is constrained by the container edges.
 Labels Copy Link  
It is possible to customise the font, colour and padding of the labels by using the scale options.
{
    gradientLegend: {
        scale: {
            label: {
                fontSize: 20,
                fontStyle: 'italic',
                fontWeight: 'bold',
                fontFamily: 'serif',
                color: 'red',
            },
            padding: 20,
        },
    },
}