highcharts / highcharts-vue

Other
686 stars 150 forks source link

Programmatically reset ZOOM #186

Closed JsonKody closed 3 years ago

JsonKody commented 3 years ago

Hello I did not found any option to programmatically reset ZOOM. It's only possible to reset by clicking on svg button, but its not an option when new data are loaded - the zoom must be reseted automatically by mine script.

Denyllon commented 3 years ago

Hi @githubGoblin ,

Thank you for contacting us. This question looks like a typical Highcharts support question, so should be asked on its repository.

Anyway, the fastest option to reset the zoom on every data update is to use combined chart.events.update handler, and call the chart.zoomOut() within the mentioned function. Please take a look on the docs and demo attached below.

API Reference: https://api.highcharts.com/class-reference/Highcharts.Chart#zoomOut

Live example: https://codesandbox.io/s/highcharts-vue-demo-forked-tx4ie

Kind regards!