I'm using Highcharts and trying to set the select state on a point and maintain the state.
I can set the state just fine, like this:
var chart = new Highcharts.Chart(options);
chart.get('b').setState('select');
But the state gets unset when the user mouses over and then out of the point.
Here is a JSFiddle example - try mousing over the red point and observe that it loses its select state: http://jsfiddle.net/o72xgtfm/1/
Shouldn't the state be maintained even after mouseover, given that it's a select state, not hover?
All I want is to set the point as red, and keep it red. Could I perhaps set a custom state that wouldn't be affected by mouseover?
I managed to fix this eventually by using:
point.select(true, true);
rather than
point.setState('select');
The latter is undocumented, whereas the first seems to be the official way to do things.
Reference: https://api.highcharts.com/class-reference/Highcharts.Point#select
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With