Black Lives Matter. Please consider donating to Black Girls Code today.

How to highlight the line (change width of the line) on mouse hover?

Hello,

I would like to highlight the line (change width of the line) on mouse hover event, like guys from highcharts do. Please check https://www.highcharts.com/stock/demo/compare

Is it possible to do that?

Thank you

I think it is possible. You should relayout the plot using the hover event.

@dmancera,
Thank you, for your answer.
Do you know if there is any built-in functionality, which could do that?

If going ‘hover’ route,
Let’s assume I have 4 traces on the chart, how could I determine which line I’m currently hovering?

I use this code i saw in the documentation pn will be the point and tn the trace number. The data is the param returned by the hover function. I use it with clicks, but i think it will be the same with hover.

    var pn = '';
    var tn = '';
    for (var i = 0; i < data.points.length; i++) {
        pn = data.points[i].pointNumber;
        tn = data.points[i].curveNumber;
    }