Charts: Axis titles?

Created on 13 Aug 2015  Â·  5Comments  Â·  Source: danielgindi/Charts

Is there a way to define labels for the titles of axes? I'd like to use them to state the units of the y-axis.

For example I'd like a label drawn to the left of the number labels on the y-axis that says "hits / minute" to tell the user the units of the graph.

Most helpful comment

Subclass NSNumberFormatter to return strings as you need. And then pass it to the axis:

self.chartView.leftAxis.valueFormatter = [MyCustomNumberFormatter new];

All 5 comments

Subclass NSNumberFormatter to return strings as you need. And then pass it to the axis:

self.chartView.leftAxis.valueFormatter = [MyCustomNumberFormatter new];

Sorry, that's not what I meant. I'm talking about titles for the axes, to present unit information.

Check out the chart below for an example:

chart

It has the axis titles "Farms" and "Total Produce". Is there any way to create labels like that in ios-charts?

Well, then it's indeed a duplicate of #35. Might make sense to add your voice there ;)

Subclass NSNumberFormatter to return strings as you need. And then pass it to the axis:

self.chartView.leftAxis.valueFormatter = [MyCustomNumberFormatter new];

I have spent a lot of time trying to find yAxis property. Did not even think that it can be called "left axis". Thank you! Your comment saved me a lot of time...

Was this page helpful?
0 / 5 - 0 ratings