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

How to set the label count for X axis ? #2548

Closed
samarth220194 opened this issue Jun 22, 2017 · 5 comments
Closed

How to set the label count for X axis ? #2548

samarth220194 opened this issue Jun 22, 2017 · 5 comments

Comments

@samarth220194
Copy link

In my data, I have hundreds of values for the x-axis, but I want to show only 6 or 7 of them at equal intervals so that my whole range of x-axis values are covered, but I am facing an issue as I am not able to show a limited number of values on the x-axis . I tried these
lineChartView.xAxis.spaceMin = 4 lineChartView.xAxis.spaceMax = 7 lineChartView.xAxis.xOffset = 6 lineChartView.xAxis.labelCount = 6 lineChartView.xAxis.labelCount = 6
, but it is not working .Here is my screenshot for the display
screen shot 2017-06-22 at 10 18 47 am

@cartmanguo
Copy link

try this:
lineChartView.xAxis.setLabelCount(7, force: true)

@samarth220194
Copy link
Author

I got it right .I was not parsing the data properly .The above shown data in the x axis is a string separated with commas.Thats why it was causing problems .Thank man 👍

@samarth220194
Copy link
Author

One question i wanted to ask : How to remove the value being written on the chart .That "110" in the above screenshot

@liuxuan30
Copy link
Member

disable drawValuesEnabled

@ioskunal
Copy link

ioskunal commented Jul 8, 2020

I was getting one less value at the end. The reason was I had set lineChartView.xAxis.centerAxisLabelsEnabled = true. Setting it to false if the trick.

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