核心图目标 c:为什么使用自定义标签时不显示网格线
我正在尝试绘制带有网格线和自定义标签的条形图。不幸的是,我无法让它同时显示自定义标签和网格线。为了拥有网格线,我需要将轴labelingPolicy设置为CPTAxisLabelingPolicyAutomatic,但这不再显示自定义标签。我是否做错了什么,或者是否有正确的方法来实现我想要实现的目标。谢谢。
I'm trying to draw a bar chart with gridlines and custom labels. Unfortunately I can't get it to display both custom label and gridlines. To have gridlines I need to set the axis labelingPolicy to CPTAxisLabelingPolicyAutomatic but this does not show the custom label any more. Is there anything I am doing wrong or is there a correct way to do what I am trying to achieve. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用自定义标签时,您还必须设置
majorTickLocations
和/或minorTickLocations
。网格线绘制在相应的刻度位置。When using custom labels, you also have to set the
majorTickLocations
and/orminorTickLocations
. The grid lines are drawn at the corresponding tick locations.