samirthakral
Posts: 1
Joined: Tue Mar 28, 2023 6:45 pm

Selective Mouse Tracking on Large Data Sets

Hi,

I have a normal "Line" series which contains interpolation of data to smooth the curve. I have around 300 points but only 50 are relevant to the user, so we don't want to have mouse tracking on 250 on those points. We don't even want the marker on it not hover on it. I implemented this code, which does the job but I lose the normal mouse tracking feature on it which makes it hard to track the relevant unless you are hovering over it and come across it. The normal mouse tracking allows highlights the closest point but not when I implement it this way. This is how each item of the data array looks like:

Code: Select all

{
                x: some number,
                y: some number,
                events: {
                    mouseOver: function (e: MouseEvent) {
                        return (true for valid point/false for interpolation)
                    }
                },
                marker: {
                    states: {
                        hover: {
                            enabled: (true for valid point/false for interpolation)
                        }
                    }
                }
}
Is there a way I can get the mouse tracking to behave normally where it only cares about relevant points?
jakub.j
Posts: 1091
Joined: Tue Jan 24, 2023 11:14 am

Re: Selective Mouse Tracking on Large Data Sets

Welcome to our forum and thanks for contacting us with your question!

You mentioned that you interpolate the data to smooth the curve, the solution for this might be using spline series instead of line, it is already smoothed by default, so you don't need to take any additional actions. Check out the demo below.

Demo: https://jsfiddle.net/BlackLabel/49xa0h1y/

If that doesn't help you, please send me a live demo in jsfiddle.net or any other online tool so I can dig into your code and then I will be able to help you.

Best regards
Jakub

Return to “Highcharts Usage”