When moving the mouse over a heatmap in a ChartXY, you can get the xyz values of the mouse position by setting up the AutoCursor and displaying the ResultTable. But how can you get those values as an event for instance or at least by calling a method in the chart component?
Asked
Active
Viewed 160 times
1 Answers
0
You can solve the nearest heatmap data point relative to a location on screen using series.solveNearestFromScreen method.
Please refer to this example for usage reference. While it is using a LineSeries, this methods usage is almost identical for heatmaps.
Something that is unfortunately missing from the documentation (as well as typings) is the property for the data point intensity in case of heatmaps. This you can access via location.cellValue
property.

Niilo Keinänen
- 2,187
- 1
- 7
- 12
-
Thanks Niilo - this works! The cellValue property however doesn't seem to be available from the Point (location) object in the typescript type defs "lcjs.d.ts". I had to work around that by stringifying the location object and parsing it again into an object with a cellValue property. – MikeT Jul 21 '22 at 10:57
-
I also noticed this typings issue. Instead of stringifying I would cast it to first unknown and then a custom type which has this missing property. We'll be fixing this. – Niilo Keinänen Jul 22 '22 at 11:37