Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Core-Plot X-Axis Label Position Offset

Tags:

axis

core-plot

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.

like image 352
futureelite7 Avatar asked Jul 17 '12 01:07

futureelite7


2 Answers

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.

like image 80
Matt Avatar answered Nov 01 '22 02:11

Matt


The property your looking for is axisSet.xAxis.labelOffset

like image 2
Jesse Crocker Avatar answered Nov 01 '22 02:11

Jesse Crocker