rangePaddingHigh / rangePaddingLow - when/how to set?


I’m having trouble getting the rangePaddingHigh / rangePaddingLow properties to take effect on SChartAxis objects. E.g.

        NSNumber *padding = @(self.chart.yAxis.dataRange.span.doubleValue * 0.1);
         self.chart.yAxis.rangePaddingHigh = padding;
         self.chart.yAxis.rangePaddingLow = padding;

Should the chart redraw itself after setting these properties or do I need to tell it to do so? When is it OK to set these properties? FWIW I’d find it far more useful to be able to set this as a percentage up front and forget about it.


ShinobiCharts - Version: 2.7.3-1, Edition: Premium, Release Date: Sep  9 2014


Hi jscalo,

Once you have set the rangePaddingHigh & Low values to suitable data values you have to redraw your chart for these values to take affect.

However, if you set these properties when setting up your chart you don’t need force your chart to redraw as it will take your values into account when first rendering your chart. 

Let me know if you have any questions.

Kind regards,
Andrew Polkinghorn


I found the problem: elsewhere I was setting the defaultRange on the axis object not realizing that this overrides whatever range padding has been added. The “default” in the property name led me to think that it was more of a starting point. Can I suggest documenting this behavior? Thanks.


Hi Jscalo,

I’ll raise that in our backlog - thanks for point it out.