Core-Plot X-Axis Label Position Offset
Asked Answered
E

3

5

I'm trying to shift the x-axis labels upwards. Is there a property that I can set to do that? I've tried adding some bottom padding to the plot frame, but all that does is to squeeze the entire plot upwards.

Eternalize answered 17/7, 2012 at 1:9 Comment(0)
D
5

Another question answered on Stack Overflow led me to change 'orthogonalCoordinateDecimal'. For instance:

    axisSet.xAxis.orthogonalCoordinateDecimal = CPTDecimalFromString(@"0") 

This caused my X-axis to pass through the origin. To raise my X-axis in relation to my graph, I changed the value to '25000', as in:

    axisSet.xAxis.orthogonalCoordinateDecimal = CPTDecimalFromString(@"25000")

On thing to be mindful of is scale. My values in this case ranged from 0 - 185,000 so a shift of 25,000 is approximately equivalent to a shift of 4 when the upper value of the axis is 30 (days in my case, just for example). I was originally trying to shift the 0-185,000 axis by 5.0, and wondering why it had no effect, thinking it was a measurement of screen real estate instead of a scaled value.

Delude answered 18/7, 2012 at 19:46 Comment(0)
A
2

The property your looking for is axisSet.xAxis.labelOffset

Alpha answered 17/7, 2012 at 13:43 Comment(0)
P
1

It is not totally clear, may be you need this

x.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0];

Or to display labels above axis you can use this:

x.tickDirection = CPTSignPositive;
Perpetual answered 17/4, 2014 at 13:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.