enot
enot

Reputation: 161

How to highlight the axis?

I have many axes in the chart.

How to highlight the axis when hovering on a line(axis-value)?

It is necessary to highlight the axis to which the line(axis-value) belongs (when hovering on a line(axis-value))

(Highlight = make bold or change color)

Sorry for the bad english :)

enter image description here

Upvotes: 0

Views: 255

Answers (1)

ezanker
ezanker

Reputation: 24738

You could use the seriesHover event:

seriesHover: function(e) {
    var axis = e.sender.getAxis( e.series.axis);
    for (var i=0; i<e.sender.options.valueAxis.length; i++){
        if (i ==axis._axis.axisIndex){
            e.sender.options.valueAxis[i].line.width = 3;
        } else {
            e.sender.options.valueAxis[i].line.width = 1;
        }                   
    }
    e.sender.refresh();
}

From the series you can get theassociated axis, then set the axis line width and refresh the chart.

DEMO

Upvotes: 1

Related Questions