Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axis titles? #299

Closed
timgshi opened this issue Aug 12, 2015 · 5 comments
Closed

Axis titles? #299

timgshi opened this issue Aug 12, 2015 · 5 comments

Comments

@timgshi
Copy link

timgshi commented Aug 12, 2015

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.

@yas375
Copy link
Contributor

yas375 commented Aug 13, 2015

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

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

@danielgindi
Copy link
Collaborator

Duplicate #35

@timgshi
Copy link
Author

timgshi commented Aug 19, 2015

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?

@yas375
Copy link
Contributor

yas375 commented Aug 20, 2015

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

@DJ-Glock
Copy link

DJ-Glock commented Sep 27, 2018

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants