简体   繁体   English

控制显示的y轴标签?

[英]Controlling shown y-axis labels?

So I am using the Charts framework (formerly ios-charts) for a couple of charts. 所以我正在使用Charts框架(以前是ios-charts)来绘制几个图表。

One of them in a bar chart where the y-axis is duration in seconds - that I then convert into readable minute:second notation with a formatter. 在条形图中,其中之一是y轴的持续时间(以秒为单位),然后我使用格式器将其转换为可读的min:second表示法。

But the selected interval of labels bugs me a little. 但是选择的标签间隔使我有些烦恼。 I would like to control them so they are only shown at intervals that makes sense for this - like say every half or full minute. 我想控制它们,以便仅在对此有意义的时间间隔内显示它们-例如每半分钟或整分钟。 But I can't seem to find a way to do that for that axis. 但是我似乎找不到找到该轴的方法。 Only the x-axis seems to have options for that? 只有X轴似乎可以选择吗?

So am I missing something here? 那我在这里想念什么吗? Or it is not in the framework? 还是它不在框架中?

Whoops. 哎呀 Never mind. 没关系。 I found the 'granularity' property on the axis right after asking. 问完后,我立即在轴上找到了'granularity'属性。 And it seems to do what I need. 它似乎可以满足我的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM