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

Custom label for LineChart #1248

Closed
cohendl opened this issue Jul 13, 2016 · 6 comments
Closed

Custom label for LineChart #1248

cohendl opened this issue Jul 13, 2016 · 6 comments

Comments

@cohendl
Copy link

cohendl commented Jul 13, 2016

Is it possible to change the labels on the LineChart that doesn't involve NSNumberFormatter? For example, I'm mapping integers to Emoji's in a rating system and would like to display the Emoji rather than the integer.

Thanks!

@dxclancy
Copy link

See my posts on this elsewhere.

@liuxuan30
Copy link
Member

There is PR for such requests I remember, it's still not finished yet. You can take a look #641, or just search what @dxclancy mentioned.

@cohendl
Copy link
Author

cohendl commented Jul 14, 2016

I wasn't asking for PR, just wondering if it was possible. Sounds like the answer is no at this time?

@dxclancy
Copy link

yea it is possible.

@cohendl
Copy link
Author

cohendl commented Jul 14, 2016

Do you have a link to thread that explains how or the class/method I can use please? I've been searching on here and stack overflow for days. Thanks!

@dxclancy
Copy link

dxclancy commented Jul 14, 2016

So, I suggested that you look at my posts. If you don't know how to filter issues based on a user, you should learn. It will be helpful to you.

Filtering based on me turns up several related to NSNumberFormatter, which need only a quick scan, including #943 which includes the following:

If not, the simplest thing to do is to write a subclass of NSNumberFormatter that overrides stringFromNumber and pass that value to an NSDateFormatter, or perform you own custom formatting.

So, in other words, you mentioned wanting something other than NSNumberFormatter to format emojis. In this case, if you know where you would pass an NSNumberFormatter, you can instead pass your own subclass of NSNumberFormatter that overrides stringFromNumber to return emojis. I assume these are unicode emojis, so returning the unicode would cause charts to draw the emoji.

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

3 participants