简体   繁体   English

Amcharts:是否可以通过自定义按钮来控制图表的缩放级别?

[英]Amcharts: Is there a way to control zoom level of the chart by custom buttons?

I am using serialChart provided by amCharts. 我正在使用serialChart提供的serialChart。

It is possible to have chartScrollBar to control the zoom level of the chart but is it possible to have custom zoom-in and zoom-out buttons that control the same functionality? 可以使用chartScrollBar来控制图表的缩放级别,但是是否可以具有控制相同功能的自定义放大和缩小按钮?

It's possible to control the zoom through external buttons, but you're limited to the serial chart's zoom API methods. 可以通过外部按钮控制缩放,但仅限于串行图的zoom API方法。 For a date-based chart, you can use zoomToIndexes , and zoomToDates , whereas a non-date based categoryAxis supports zoomToIndexes and zoomToCategoryValues . 对于基于日期的图表,可以使用zoomToIndexeszoomToDates ,而基于非日期的categoryAxis支持zoomToIndexeszoomToCategoryValues To zoom completely out, you can use the zoomOut method. 要完全缩小,可以使用zoomOut方法。

Here's a demo that has external form elements and buttons that call each of the zoom methods for a date-based chart. 这是一个具有外部表单元素和按钮的演示 ,这些元素和按钮调用基于日期的图表的每种缩放方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM