核心情节:轴标题随机显示,并不总是有效
我试图显示我的 X 和 Y 轴标题,但它们似乎并不总是有效:
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);
有时 X 标题会显示,但 Y 轴标题永远不会显示。为什么他们不显示?是填充物吗?
plotAreaFrame.paddingLeft = 50;
plotAreaFrame.paddingTop = 10;
plotAreaFrame.paddingRight = 20;
plotAreaFrame.paddingBottom = 50;
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 the 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;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要增加底部和左侧的填充。您的标题偏移量大于两个轴上的偏移量,因此标题被隐藏。
You need to increase your bottom and left padding. Your title offsets are more than that on both axes so the titles are hidden.