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

chart 3.0 xAxis labels not mapped #2447

Closed
yanjf90 opened this issue May 17, 2017 · 1 comment
Closed

chart 3.0 xAxis labels not mapped #2447

yanjf90 opened this issue May 17, 2017 · 1 comment

Comments

@yanjf90
Copy link

yanjf90 commented May 17, 2017

when I use [[BarChartDataEntry alloc] initWithX: x y: y] add to dataset, and set the xaxis formatter.
[ChartDefaultAxisValueFormatter withBlock:^NSString * _Nonnull(double value, ChartAxisBase * _Nullable axis) ,

but the value does not equals to x. it seems value is recalculated ? for example I pass x from 0-7, but the value may be (0, 0.9, 1.8. 2.7 ...), sometimes , when I removed the labelCount is works well, but not always. Is somethis wrong?

@liuxuan30
Copy link
Member

liuxuan30 commented May 18, 2017

x axis labels(entries) are calculated in calculateAxisValues(), and it has its own algorithm by default. You can override it and feed xAxis.entries what you need, or use forceLabelEnabled if the logic suits you. Just take a look.

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