开发者

Core Plot: Axis titles show randomly, not always working

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜