chartjs-plugin-crosshair icon indicating copy to clipboard operation
chartjs-plugin-crosshair copied to clipboard

Tooltips not showing if data is sorted descending on the x axis

Open danmana opened this issue 4 years ago • 0 comments

When the dataset data is not sorted ascending by x value the interpolation does not work.

https://codepen.io/danmana/pen/mdVPbEb?editors=1010

Interpolate assumes the data is sorted ascending when searching for the matching index on hover. https://github.com/AbelHeinsbroek/chartjs-plugin-crosshair/blob/master/src/interpolate.js#L31

If making this work with desc data complicates things too much, we should at least document this behavior.

danmana avatar Jun 11 '20 08:06 danmana