Shinobi Charts fraction digits number and baseline definition


#1

I’m trying to render a chart which can have decimal value on the Y-axis.
Let’s say my x-Axis series is [1,2,3,4,5] and and I have two potential y-Axis series: [0.3424,0.6736,0,-0.2343,-0.8766] or [2,4,6,22,34].

Now in the first case I would like to limit the number of fraction digits displayed on the y-Axis to 2,whilst in the second case I would like to set the chart baseline to 0 (otherwise the range would be from 2 to 34). 

How can I achieve this?

Thanks


#2

You can assign a NSNumber formatter to your chart’s axis. If you set up your formatter to have a maximum number of fraction digits, your axis will use it, and respect the same format.

As for your second question, have you tried setting the baseline property of your series to 0?

series.baseline = @0;

Jan