簡體   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