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

NaN makes highestVisibleXIndex crash #980

Closed
iangmaia opened this issue Apr 26, 2016 · 8 comments
Closed

NaN makes highestVisibleXIndex crash #980

iangmaia opened this issue Apr 26, 2016 · 8 comments

Comments

@iangmaia
Copy link
Contributor

In some scenarios, when scrolling from the rightmost side of a CandleStick chart to the leftmost side, I'm getting a crash when reaching the beginning of the chart at the highestVisibleXIndex in the calcXBounds method callend when drawing.

In the highestVisibleXIndex getter:

        getTransformer(.Left).pixelToValue(&pt)

This line results in pt.x and pt.y being NaN, and then it crashes when it tries to round it.

Any ideas on why could this happen?

@liuxuan30
Copy link
Member

if pixelToValue returns NaN, have you checked pt itself, or the matrix messed up.
Need you to debug more on this, we have limited knowledge right now

@danielgindi
Copy link
Collaborator

Does this still happen?
I cannot reproduce this issue. Maybe put in a piece of code that triggers it in the Demo?

@iangmaia
Copy link
Contributor Author

It still does happen.
One thing that probably is affecting / causing it (it shouldn't, I would expect) is that I'm changing the zoom / doing a refresh on the viewPortHandler as the user moves the map.
That is done to adjust the candlesticks heights dynamically and making all the candles fit in the screen at the same time (this is google finance and many other apps behaviour).

The problem is somewhat rare but it happens in some cases I couldn't identify yet.

@liuxuan30
Copy link
Member

liuxuan30 commented May 19, 2016

well could you capture or even reproduce the crash? We have to know more to locate the issue

@iangmaia
Copy link
Contributor Author

I could reproduce it quite easily when I reported originally but now I can't anymore :( it seems that it happened with some specific data pattern that isn't happening any longer.

Anyway, I guess you guys can close this issue if you want until I can get a stack trace, simulate it or something like that.

@liuxuan30
Copy link
Member

sure thing. When you see the crash(hopefully not), please debug as possible as you can, especially the chart transformers matrix values.

@chrisozenne
Copy link

Ran into this crash today. Only happens when I have yAxis.startAtZeroEnabled = NO;. If I set it to YES, the problem goes away.

@danielgindi
Copy link
Collaborator

If you are using startAtZeroEnabled then this crash did not happen... Because you are not using the latest version, or even the version before that! :)

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