简体   繁体   English

可以在时间序列Highcharts中设置最小和最大缩放吗?

[英]Is possible to set min and max zoom in Time series Highcharts?

Hello I'm working at Time series, zoomable charts of highcharts 你好,我在时间序列中工作,高图的可缩放图表

http://www.highcharts.com/demo/line-time-series http://www.highcharts.com/demo/line-time-series

Is it possible to set minimum and maximum zoom ratio? 可以设置最小和最大缩放比例吗?

This is the data of x-axis: 这是x轴的数据:

data: [
[Date.UTC(2013,5,2),0.7695],
[Date.UTC(2013,5,3),0.7648],
[Date.UTC(2013,5,4),0.7645],
[Date.UTC(2013,5,5),0.7638],
[Date.UTC(2013,5,6),0.7549],
[Date.UTC(2013,5,7),0.7562],
[Date.UTC(2013,5,9),0.7574],
[Date.UTC(2013,5,10),0.7543],
[Date.UTC(2013,5,11),0.7510],
[Date.UTC(2013,5,12),0.7498],
[Date.UTC(2013,5,13),0.7477],
[Date.UTC(2013,5,14),0.7492],
[Date.UTC(2013,5,16),0.7487],
[Date.UTC(2013,5,17),0.7480],
[Date.UTC(2013,5,18),0.7466],
[Date.UTC(2013,5,19),0.7521],
[Date.UTC(2013,5,20),0.7564]
]

I would like that when open the page the interval between data is weekly , when the zoom is at maximum, the interval is daily and when zoom is at minimum the interval is monthly . 我想在打开页面时, 数据之间的间隔是每周一次 ,当缩放最大时,则是每天一次,而当缩放最小时,则是每月一次

I enabled scrollbar for x-axis. 我为x轴启用了滚动条。

Is it possible? 可能吗? There's a way to do so? 有办法吗?

In the highcharts you can set minRange parameter which define maximum zoom level. 在高图中,您可以设置minRange参数,该参数定义最大缩放级别。

You can also catch afterSetExtremes event and calculate range which you need to have on xAxis. 您还可以捕获afterSetExtremes事件并计算在xAxis上需要具有的范围。 Next step is call setExtremes with new range. 下一步是使用新范围调用setExtremes Obviosuly take care about any flag to avoid infitity loop. 显然要注意任何标志,以免导致不适应循环。

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

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