Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Merging all the same data points.

Open MrTob opened this issue 1 year ago • 2 comments

Feature Proposal

Let's assume that I have over 10 000 data points that always have the same value. Then I have data points that have a different value, now I want to show a tooltip for all data with the same value, but this is only possible if I draw a data point, can I also create a tooltip for a certain area. image

Possible Implementation

I would like to merge all the same data points into two (start and end point), and then hover over the line. The red line shows the concept. image this would give a big performance advantage especially if a lot of data points are to be displayed.

MrTob avatar Jul 21 '22 14:07 MrTob

This feels like it might be an optimization of the decimation plugin. Right now that plugin is the best way to achieve the reduction in points that you're looking for

etimberg avatar Jul 24 '22 22:07 etimberg

For the tooltip, you could use interpolation: https://codepen.io/kurkle/pen/WNpdwgE

kurkle avatar Jul 25 '22 15:07 kurkle