繁体   English   中英

如何限制chartIQ库中的最小和最大缩放

[英]How to limit min and max zoom in chartIQ library

我使用chartIQ库: https ://www.chartiq.com我的目标是限制最小和最大图表缩放。 我该怎么做?

要设置最小缩放,可以设置ChartEngine.minimumZoomTicks字段。

http://documentation.chartiq.com/CIQ.ChartEngine.html#minimumZoomTicks

stxx.minimumZoomTicks=5; // when zoomed all the way in only 5 bars will show

恐怕没有一个字段可以反映该缩小功能,但是您可以通过利用prepend注入功能以及将zoomOutSpeed设置为1来实现您要完成的任务。

http://documentation.chartiq.com/tutorial-使用%20the%20Injection%20API.html

http://documentation.chartiq.com/CIQ.ChartEngine.html#preferences%5B%60zoomOutSpeed%60%5D

var stxx = yourChartInstance;
stxx.preferences.zoomOutSpeed=1;
stxx.prepend("zoomOut", function() {
    for(var chartName in stxx.charts){
        var chart=stxx.charts[chartName];
        chart.maxTicks=20; // this will set the maximum number of bars on the screen, along with zoomOutSpeed
    }
});

如果您还有其他疑问,请直接发送电子邮件至support@chartiq.com与ChartIQ联系。

暂无
暂无

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

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