如何以编程方式放大highcharts? [英] How to programmatically zoom in highcharts?
问题描述
调用axis.setExtremes()或axis.zoom()时,关联的缩放按钮不会突出显示。
例如,
有没有简单的方法来完成这个?
对于更多的上下文:我想做我的应用程序,所以如果你查看一个图形,缩放,然后离开图表,并再回到它,我想恢复你的'缩放级别'。
我基本上是通过监听afterSetExtremes并存储最大/最小值,然后在图上调用'zoom'用户返回。
如果有一个更简单的方法来完成这个,我会很好。
您也可以在按钮上调用setState。
chart.rangeSelector.buttons [3] .setState(2);
When calling axis.setExtremes() or axis.zoom(), the associated zoom button does not become highlighted.
For example, if I programatically 'zoom' to 1-hour, I would like the '1 hour' zoom button to appear as 'pressed'.
Is there a simple way to accomplish this?
For more context: I want to make my app stately, so that if you view a graph, zoom, then navigate away from the graph and back to it again, I want to restore your 'zoom level'.
I have this basically working by listening for afterSetExtremes and storing the max/min values, and then using those to call 'zoom' on the graph when the user returns.
If there is a simpler way to accomplish this, I'd be fine with that.
Thanks for any direction!
You can also call setState on the button.
chart.rangeSelector.buttons[3].setState(2);
这篇关于如何以编程方式放大highcharts?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!