I am trying to get my X and Y axis titles to show, but it seems they are not always working:
CPXYAxisSet *axisSet = (CPXYAxisSet *)graph.axisSet;
CPXYAxis *x = axisSet.xAxis;
x.orthogonalCoordinateDecimal = CPDecimalFromFloat(min);
x.title = [NSString stringWithFormat:@"Distance %@", distLabel];
x.titleLocation = CPDecimalFromFloat(7.5f);
x.titleOffset = 55.0f;
CPXYAxis *y = axisSet.yAxis;
y.orthogonalCoordinateDecimal = CPDecimalFromFloat(minDist);
y.title = @"Altitude";
y.titleOffset = 95.0f;
y.titleLocation = CPDecimalFromFloat(150.0f);
Sometimes th开发者_如何学编程e X title will show, but the Y axis title NEVER shows. Why are they not showing? Is it the padding?
plotAreaFrame.paddingLeft = 50;
plotAreaFrame.paddingTop = 10;
plotAreaFrame.paddingRight = 20;
plotAreaFrame.paddingBottom = 50;
You need to increase your bottom and left padding. Your title offsets are more than that on both axes so the titles are hidden.
精彩评论