New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Highcharts 5.0 - afterSetExtremes not triggered after Axis update #5773
Comments
Hi @qingweibinary - it should be |
Hi @pawelfus Really sorry for wasted your time, the bug is still there, but my method to reproduce was wrong Here's an updated fiddle that illustrate it correctly http://jsfiddle.net/uur9wr57/2/
|
Oh, now I see, thank you! Highcharts demo: http://jsfiddle.net/qyg3ee7b/ Steps to reproduce the issue:
|
Also affects setExtremes event |
Hi, I believe this bug needs to be reopened. The latest version of Highstock (probably Highcharts as well) still has this bug. The original chart.options object is mutated so that the callback function is removed from the config. You can work around this by adding the {event: callbackfunction} to the update call, but this creates unclean code. Here is a fiddle showing log prints that after update, the best |
Hi @thewholuver94 Thanks for reporting, but it looks right to me: http://jsfiddle.net/BlackLabel/yz4q5ts6/ - apart from missing |
Hey @pawelfus , that's true, the event is properly called in the Fiddle. In our implementation (legacy code that I can't really touch), we have decided to make dynamic changes to the chart.options object & when we want to redraw we destroy and construct a new chart each time using the options object. For users who do it this way, the event is not properly called because the event was erased from the options object. Another reason I can't just move to doing it the correct way using the Highcharts API is because we have to support Highstock 2.1.7 & Highstock 7.0.3 simultaneously & not all functionality is available in v2.1.7. I've already given a workaround above (save the callback function & send it along with the update call), but I just thought I'd let you guys know in case mutating the original options object is unwanted behavior. |
@pawelfus I am experiencing this bug again with highcharts 9. Here is an example: https://codepen.io/slutske22/pen/MWrQdvQ?editors=1011 navigator: {
height: 80,
xAxis: {
events: {
afterSetExtremes: e => {
console.log(e);
},
},
},
}, The |
Hello @slutske22! Check the following demo: https://jsfiddle.net/BlackLabel/9b1p5vkn/156/ |
@pawelfus , yes! That is exactly what I needed, thank you! |
Expected behaviour
afterSetExtremes should be triggered everytime extremes changed
Actual behaviour
It is only trigger onload, and never trigger after that despite how I change extremes
Live demo with steps to reproduce
http://jsfiddle.net/uur9wr57/
Affected browser(s)
Only tested in chrome
The text was updated successfully, but these errors were encountered: