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

yVals have decimal point #2045

Closed
shanyulaile opened this issue Jan 9, 2017 · 3 comments
Closed

yVals have decimal point #2045

shanyulaile opened this issue Jan 9, 2017 · 3 comments

Comments

@shanyulaile
Copy link

yVals incoming value with no decimal point, but when the show with decimal point, and only in the value of 95 a decimal point, how do I solve
2p

@liuxuan30
Copy link
Member

change valueFormatter to a proper NSNumberFormatter, and change maximumFractionDigits, minimumFractionDigits to meet your goals.

@shanyulaile
Copy link
Author

Dear liuxuan30

NSNumberFormatter *leftAxisFormatter = [[NSNumberFormatter alloc] init];
leftAxisFormatter.minimumFractionDigits = 0;
leftAxisFormatter.maximumFractionDigits = 1;
self.linechartiew.leftAxis.valueFormatter = [[ChartDefaultAxisValueFormatter alloc] initWithFormatter:leftAxisFormatter];

I shall be carried out in accordance with the above Settings, did not achieve the desired results, is a set of values is there a problem?

@liuxuan30
Copy link
Member

take a look at NSNumberFormatter's properties to find the one you need to change. I just meant that you can customize the formatter as you like. If you don't want decimals, just maximumFractionDigits = 0.

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

2 participants