Skip to main content
Version: 8.3.1

Heatmap

PolarChart includes a feature for rendering high resolution Polar heat-maps. This can mean up to millions or even billions of data points displayed at high speed and colored according to user configured color rules.

Polar heatmap chartPolar heatmap chart

With LightningChart, Polar heatmaps charts are extremely similar to 2D Heatmaps. As such, we recommend you to also check out the Heatmap guide.

// Creation of polar heatmap series
const heatmapSeries = chart
.addHeatmapSeries({
sectors: 4,
annuli: 3,
amplitudeStart: 0,
amplitudeEnd: 1,
})

Data input

Heatmaps consume data as uniform number matrixes. You can imagine this as a table of numbers:

annulus 0annulus 1annulus 2
sector 0048
sector 1159
sector 22610
sector 33711
heatmapSeries.invalidateIntensityValues([
[0, 1, 2, 3],
[4, 5, 6, 7],
[8, 9, 10, 11],
])

"uniform" means that the amplitude and radial step between each measurement is always the same.

Polar heatmap data valuesPolar heatmap data values

Color lookup

Heatmaps are colored using a LUT (value <-> color lookup table). This defines the rules for picking a color from a data value.

heatmapSeries.setFillStyle(new PalettedFill({
lut: new LUT({
interpolate: true,
steps: [
{ value: 0, color: ColorRGBA(255, 0, 0) },
{ value: 10, color: ColorRGBA(0, 0, 255) },
],
}),
}))

Polar heatmapPolar heatmap

For more details about style API, please see Styles, colors and fonts.

Percentage color lookup

LUT has also a percentageValues option, which you can use if you want to use % values of the present min-max lookup value range, rather than specific value steps:

new LUT({
percentageValues: true,
interpolate: true,
steps: [
// 0 = 0 %, 1 = 100%
{ value: 0, color: ColorCSS('red') },
{ value: 1, color: ColorCSS('green') },
]
})

Polar heatmap currently doesn't support percentageValues! If your use case requires this, please contact us.

Intensity interpolation

// Enable intensity interpolation
heatmapSeries.setIntensityInterpolation('bilinear')

Polar heatmapPolar heatmap

// Disable intensity interpolation
heatmapSeries.setIntensityInterpolation(undefined)

Extrapolating heatmap data from scatter data set

One common way of using heatmap charts is to extrapolate an uniform matrix from a scatter polar data set (something you would visualize with Polar Scatter Chart). For example, see the picture below, which displays both Raw samples (as scatter points) and the extrapolated heatmap:

Polar heatmap chartPolar heatmap chart

We have computation algorithms for performing this extrapolation, but they are not publicly exposed. If you would be interested in testing this, then please get in touch.

Partial data supply

Polar heatmap series also supports modifying only a sub set of the entire data array.

heatmapSeries.invalidateIntensityValues({ iSector: number; iAnnulus: number; values: number[][] })

User interactions

This section works the same as for Line, to avoid duplication of guides, please refer to the section under Line

Solve nearest from location

This section works the same as for Line, to avoid duplication of guides, please refer to the section under Line

Interactions with data points

This section works the same as for Line, to avoid duplication of guides, please refer to the section under Line