Close Editor Run Reset Auto Update CJS /*
* Example showcasing the basics of Polar Heatmap feature.
*/
const lcjs = require('@lightningchart/lcjs')
const xydata = require('@lightningchart/xydata')
const { lightningChart, Themes, LUT, PalettedFill, regularColorSteps } = lcjs
const { createWaterDropDataGenerator } = xydata
const resolutionSectors = 360
const resolutionAnnuli = 100
const polarChart = lightningChart().Polar({
// theme: Themes.darkGold
})
const polarHeatmap = polarChart
.addHeatmapSeries({
sectors: resolutionSectors,
annuli: resolutionAnnuli,
amplitudeStart: 0,
amplitudeStep: 1,
dataOrder: 'annuli',
})
.setIntensityInterpolation('bilinear')
const themeExamples = polarChart.getTheme().examples
if (!themeExamples) {
throw new Error()
}
createWaterDropDataGenerator()
.setRows(resolutionAnnuli)
.setColumns(resolutionSectors)
.generate()
.then((data) => {
const palette = new PalettedFill({
lut: new LUT({
units: '°C',
steps: regularColorSteps(0, 60, themeExamples.intensityColorPalette),
interpolate: true,
}),
})
polarHeatmap.setFillStyle(palette).invalidateIntensityValues(data)
})
JavaScript Polar Heatmap Chart - Editor Example on the basics of Polar Heatmap feature.
The Polar Heatmap allows visualizing a 2D matrix of numeric data in a polar coordinate system. The data is layed out in a grid split to sectors (angle axis) and annuli (amplitude axis).
The most important built-in features are:
Fast data and color updates. Bilinear interpolation to smoothly color pixels between data values. To learn how to extrapolate a heatmap data matrix from a scattered data set, see Polar Sensor Heatmap example