2
votes

I've been searching through the highchart API and was unable to find a way to allow max zoom out to be (say) January, follow by the next tick is 7 months later which is July and so on. And at the same time to have the max zoom in to be 1 day only.

Example:

Max Zoom Out

***Referring to above picture, at max zoom out (no zooming in) ==> x-axis label displaying Jan/2005 at the first tick, second tick is July/2005, third tick is Jan/2006, fourth tick is July/2006... and so on.

Max Zoom In ***Referring to above picture, user can at the same time zoom in to one day only max. (For this, i've done it with "minTickInterval: 24 * 3600 * 1000")

So I was able to set minimum tick interval is 1 day. However, i could not control the interval when zoom out to the max. I tried using "tickInterval" and it starts giving me 365 ticks each year on my x-axis at max zoom out. I also tried "minRange: 210 * 24 * 3600 * 1000 // 210 is # of days for 7 months", still no luck with no ticks down to days after zooming in. Currently for the max zoom out, the datetime label is auto scaled based on (i suppose) my chart or screen size.

Anyone got an idea how to do it or did i not use those api properly? I've been on this for almost a week already. Hope someone can help. Thanks.

1
anyone?? if there's no way to do it, I'll have to tell my users that this is a limitation to highcharts.Brandon
I tried for some time and couldn't do it and hence compromised with labels : {step: 14,rotation: 270}raghavsood33

1 Answers

0
votes

You can use tickPositioner to define your own function which will set ticks positions.

http://api.highcharts.com/highcharts#xAxis.tickPositioner