Customise auto range calculation


#1

Hi, 

Is there any way to tell the chart, so that the range of the y value is balanced, for example, smallest y value is -100, biggest y value is 120, so the default range of the chart is from -120 to 120? or smallest y value is -150, biggest y value is 100, so the default auto calculated range is from -150 to 150?

Cheers,

Herli


#2

The axis ranges are configurable, so you can potentially call setRangeWithMinimum:andMaximum: to set the range to your desired values. You can use the SChartDelegate methods to find when the axis is being zoomed or panned, to know when you need to call an update.

Hope this helps!


#3

Thanks, I figured out that’s how you’ll customise it.

So let say if you have chart with y axis range of -150 to 150. Is there any way to change the zoom behaviour? So when you do the pinch, the zoom starts on y axis zero value, rather than where your fingers are? So with pinching, you’re manipulating the zoom level of the y axis, with value zero as your starting zoom point.


#4

Okay, found the solution by adjusting it on isZooming: delegate. 

Is there anyway to set a threshold so, let say when you try to zoom by pinching diagonally, depending on the angle, it only zoom on one direction?


#5

Hi Herli,

I’m afraid the gestures don’t support this functionality at the moment, however you can disable x- or y-based panning on an individual basis, manually, by settting enableGesturePanning on each axis.

Hope this helps,

Rob