Margin for scatter series in Shinobi Charts on iOS

551 Views Asked by At

I'm using a scatter series in Shinobi Charts but points with maximum and minimum x and y values are being truncated because they're at the edge of the plot area?

How can I add a small margin to the plot area so I can clearly see the scatter points and none are truncated. I realise that I can set the range of each axis myself but that gets into nasty math to work out what a 5px margin would be over the lowest/highest values etc.

1

There are 1 best solutions below

2
On

There are 2 properties on SChartAxis which can help you: rangePaddingLow and rangePaddingHigh. These values are absolute values, and in the scale of the axis.

For example, if you have an axis which has an automatic range of (0,100), then the following would update the range to (-5, 105):

axis.rangePaddingLow = @5;
axis.rangePaddingHight = @5;

As the axis scale updates, these padding values will be maintained.