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

Programatically scroll to end of line chart #809

Closed
osolano opened this issue Mar 7, 2016 · 5 comments
Closed

Programatically scroll to end of line chart #809

osolano opened this issue Mar 7, 2016 · 5 comments

Comments

@osolano
Copy link

osolano commented Mar 7, 2016

I have a line chart that is set to only show 6 data points but the line chart loads 30 data points in total. Was wondering if there is a way to set the chart to start at the end instead of the beginning or programatically scroll to the end or last data point?

@liuxuan30
Copy link
Member

use moveViewToX
Moves the left side of the current viewport to the specified x-index.
This also refreshes the chart by calling setNeedsDisplay().

@osolano
Copy link
Author

osolano commented Mar 8, 2016

Thank you! @liuxuan30

@bj97301
Copy link

bj97301 commented Mar 7, 2017

I am having an issue when trying to move all the way to the right while hiding the right axis label: chartView.rightAxis.enabled = false
When the right axis label is hidden, moveViewToX seems to go to the right minus the space that would be there for the label. Otherwise, moveViewToX works just fine when the right label is not hidden as shown below:

not hidden:
https://cloud.githubusercontent.com/assets/1450431/23683053/c88d29da-034b-11e7-8131-36481a99a0be.gif

hidden:
https://cloud.githubusercontent.com/assets/1450431/23682949/331fac4c-034b-11e7-8b9b-b664239836d2.gif

@jtweeks
Copy link

jtweeks commented Oct 5, 2017

Same issue here

@marshtupa
Copy link

I find solution that helps me! Check this comment
#450 (comment)

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

5 participants