Axis ranges not being calculated correctly?


I’m using ShinobiChart 2.5.4, and I have a custom model object which conforms to the SChartData protocol. For its x value it returns an NSDate *, and for its y value it returns an NSNumber *. My x axis is being automatically calculated correctly, but my y axis is always left at [0, 1], and even manual attempts to change it have very strange behavior.

E.g., calling [chart.yAxissetRangeWithMinimum:chart.yAxis.dataRange.minimumandMaximum:chart.yAxis.dataRange.maximum] returns true (and the minimum and maximum are what I expect - floating point values between 50 and 60), but then my actual axis changes to [-0.25, 1.25]. If I change the yValue function to return an NSDate* instead, the y axis range is then calculated correctly. Can I not use NSNumbers, or is there something special I need to do to make them work? Thanks.


Follow-up - I revered back to version 2.1.1, and with no other changes, everything is working correctly.


Thanks for the information - we’ll definitey look into this. If you could send a project that reproduces this to that would be a great help.

Colin E.


Project sent (via a dropbox share link to - it was ~15 MB zipped).


Hi Jgallagher! This is a known issue that we recently fixed. It is going to be included in our next minor release, which should be in a couple of days.

The issue actually surfaces when your data range is 0, and since all your Y-values are @50, your dataset had a range of 0. By changing your datapoint subclasses sCharYValue to the following I managed to get your range calculating properly:

int x;
- (id)sChartYValue
    return @(x);

Please let us know if the new release doesn’t fix your issue :grin:. I’ll post on this thread when it is available!



Hi John,

Our latest release of ShinobiCharts is now out (version 2.5.5), which should fix this issue. Give it a go, and let me know how things go!

Many thanks,



Yep, that fixed it! Thanks. (Sorry for the long delay.)


No worries!

Glad that that fixed your issue.