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

What is the meaning of xValue in moveViewToAnimated? #2366

Closed
fogisland opened this issue Apr 16, 2017 · 1 comment
Closed

What is the meaning of xValue in moveViewToAnimated? #2366

fogisland opened this issue Apr 16, 2017 · 1 comment

Comments

@fogisland
Copy link

fogisland commented Apr 16, 2017

Is the xValue means the actual value, or just the index ?

I want to use moveViewToAnimated to scroll the chart to the max x position, but it always crashes.

Even I call the API like this:

moveViewToAnimated(xValue: 0.0, yValue: 0.0, axis: .left, duration: 0)

It still crashes with info 'fatal error: Double value cannot be converted to Int because it is either infinite or NaN'.

I`m using the latest version for Swift3.

Any help is appreciated, Thanks!

@fogisland
Copy link
Author

Yeah I see that after 3.0 the xValue not means index anymore.

After hours of struggling I found out the reason of the crash:

setVisibleXRangeMaximum / setVisibleXRangeMinimum must be called first before moveViewToAnimated.

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

1 participant