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

Ability to set linechart with fixed amount of x values shown and pan to other data points #762

Closed
osolano opened this issue Feb 18, 2016 · 6 comments

Comments

@osolano
Copy link

osolano commented Feb 18, 2016

It would be great to have a feature where when you create a linechart with 10 data points, when rendering you focus on only the last 5 data points. When a user then swipes or pans to the left, the chart will pan to the other data points on the chart.

For example, there are 8 total points on the chart below, but there will be a setting when loading to only show 4, and then a user can pan/scroll to left to show other data points.
image

@danielgindi
Copy link
Collaborator

There is. You use the viewPortHandler to change the viewport before showing.

@osolano
Copy link
Author

osolano commented Feb 19, 2016

Thank you @danielgindi I will try it out.

@ravitejaobelisk
Copy link

Hi @osolano , I'm also trying to get the same effect. If you got the solution please share it here. I have tried looking into viewportHandler but I was not able to get it to work.

@ravitejaobelisk
Copy link

@osolano Nevermind, I found it, using setVisibleXRange(minXRange, maxXRange) solved my issue

@liuxuan30
Copy link
Member

liuxuan30 commented Apr 15, 2016

@ravitejaobelisk take a look at refresh(), translate(), setVisibleXRange(), in view port handler. There is also a method called centerViewPort(). These should be similar purpose.

@ravitejaobelisk
Copy link

@liuxuan30 got it... Many thanks

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