Reputation: 389
Hello I'm working at Time series, zoomable charts of highcharts
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:
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.
Is it possible? There's a way to do so?
Upvotes: 0
Views: 860
Reputation: 37588
In the highcharts you can set minRange parameter which define maximum zoom level.
You can also catch afterSetExtremes event and calculate range which you need to have on xAxis. Next step is call setExtremes with new range. Obviosuly take care about any flag to avoid infitity loop.
Upvotes: 2