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

LeftAxis Labels will disappear #2044

Closed
cartmanguo opened this issue Jan 9, 2017 · 9 comments
Closed

LeftAxis Labels will disappear #2044

cartmanguo opened this issue Jan 9, 2017 · 9 comments

Comments

@cartmanguo
Copy link

cartmanguo commented Jan 9, 2017

I need to update the linechart dynamicly,when a new value arrives,I create an entry and add it the the dataset.This problem happends no matter autoScaleMinMaxEnabled property is on or off
Here's a screenshot:
thumb_img_0001

@liuxuan30
Copy link
Member

call notifyDataSetChanged() after you add new ones.

@cartmanguo
Copy link
Author

actually,I called notifyDataSetChanged() everytime I add an enrty,so this is not the problem
I'll try to make a demo to reproduce this problem and show it to you

@cartmanguo
Copy link
Author

here's a demo:https://github.com/cartmanguo/reproduceissuecharts
drag the charts project to it and run,tap the add bar button,you will see this problem I described.
Thanks. @liuxuan30

@liuxuan30
Copy link
Member

You add entry by dataSet interfaces, without letting chartData know the max value would change.
you should add entries on data's level via API lineChart.data?.addEntry(entry, dataSetIndex: 0)

@cartmanguo
Copy link
Author

still doesn't work...

@cartmanguo
Copy link
Author

and if I set autoScaleMinMaxEnabled to true, the same thing happens in issue #2053

@liuxuan30
Copy link
Member

@cartmanguo first, 'still does not work' can't help. And don't mix up different things together. I tried your project and lineChart.data?.addEntry(entry, dataSetIndex: 0) works on my side.

@cartmanguo
Copy link
Author

I'm sorry If I mixed up two unrelated issues,I just think they both have something to do with caculating,apolygize again...
I changed that line to lineChart.data?.addEntry(entry, dataSetIndex: 0),but the left axis labels still not displaying after I add the second entry,I use the latest commit of Charts
2017-01-16 1 09 30
Today I realize that maybe it's because I didn't set the granularity property,so I set it to 0.1,it seems to be ok now.

@liuxuan30
Copy link
Member

Cool, i just used what you uploaded and it works after adding that line of code

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