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 give xAxis customized labels for linechartview #1903

Closed
isunilapps opened this issue Dec 1, 2016 · 3 comments
Closed

How to give xAxis customized labels for linechartview #1903

isunilapps opened this issue Dec 1, 2016 · 3 comments

Comments

@isunilapps
Copy link

isunilapps commented Dec 1, 2016

Previously we set through this method
LineChartData(xVals: xValsList, dataSets: dataSets)
but now LineChartData have only one init method that have only dataSets.. is there any other method for giving the xVals for the graph
How to set xVals for particular DataSet ???????

@r-dent
Copy link

r-dent commented Dec 2, 2016

I set the x-values of my entries to Double-casted Int values to mimic the index behavior of the 2.x version.
Then i set chart.xAxis.labelCount to the number of values and chart.xAxis.forceLabelsEnabled to true. But it breaks as soon as you zoom in. Very frustrating. 😕

@r-dent
Copy link

r-dent commented Dec 2, 2016

I think the new IndexAxisValueFormatter should be the way to go. But in my case it still did not behave as expected. I created an issue on that. #1909

@liuxuan30
Copy link
Member

if you just want customized labels for x axis, take a look at computeAxisValues(), where it generate the value labels. But now the entry will take (x, y) and no other way.

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