If you hover on Short Term Fuel Trim
, the other plot lines are faded. How can I apply the same effect to yAxis which will fade other yAxis except Short Term Fuel Trim
Asked
Active
Viewed 195 times
1

jasonB
- 45
- 5
1 Answers
1
You can use the yAxis.update
method in the series mouseOver
and mouseOut
events to change title and labels color.
function updateYAxes(chart, exception, color) {
chart.yAxis.forEach(function(axis) {
if (axis !== exception) {
axis.update({
labels: {
style: {
color
}
},
title: {
style: {
color
}
}
}, false);
}
}, this);
chart.redraw();
}
Highcharts.chart('container', {
...,
plotOptions: {
series: {
events: {
mouseOver: function() {
updateYAxes(this.chart, this.yAxis, '#ededed');
},
mouseOut: function() {
updateYAxes(this.chart, this.yAxis, 'black');
}
}
}
}
});
Live demo: http://jsfiddle.net/BlackLabel/ju9g05xe/
API Reference:
https://api.highcharts.com/highcharts/plotOptions.series.events.mouseOver
https://api.highcharts.com/highcharts/plotOptions.series.events.mouseOut

ppotaczek
- 36,341
- 2
- 14
- 24