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

Crash in Charts v2.2.5-Swift3.0 #1570

Closed
madhikarma opened this issue Sep 27, 2016 · 5 comments
Closed

Crash in Charts v2.2.5-Swift3.0 #1570

madhikarma opened this issue Sep 27, 2016 · 5 comments

Comments

@madhikarma
Copy link

Hi there

I found a crash at runtime using the Chart2.2.5-Swift3.0 branch

In certain circumstances the CGPoint created in the lowestVisibleXIndex method returns NaN (see screenshot below)

screen shot 2016-09-27 at 16 00 54

screen shot 2016-09-27 at 16 00 52

We were hoping to use with this version of the Charts API whilst we wait for the Charts 3 / Swift 3.0 release (and with that the new APIs for the library )

Can you advise about fixing the problem or whether its safe to use the branch or if we need to Charts 3?

Thank you for your time and for this library

@madhikarma madhikarma changed the title Crash in Charts v2.3.5-Swif3.0 Crash in Charts v2.3.5-Swift3.0 Sep 27, 2016
@madhikarma
Copy link
Author

...using Xcode 8.0 GM / iOS 10 SDK and running on the iPhone 5s Simulator

@madhikarma madhikarma changed the title Crash in Charts v2.3.5-Swift3.0 Crash in Charts v2.2.5-Swift3.0 Sep 27, 2016
@liuxuan30
Copy link
Member

liuxuan30 commented Sep 28, 2016

giving the code you post, pt is just the left bottom corner, which should be a valid constant. I suspect something wrong with the transfomer or your setup. When do you get this crash? What's your x values, and data entries at that moment?

Could you debug more? e.g. print out viewPortHandler.contentRect, print out pt value before transfrom, print out the transformer pixelToValueMatrix, print out pt after transform.

if pt is really the valid left bottom corner point coordinates, and after the transform, it is NaN? Then the matrix messed up.

Also, it's better it can be produced by ChartsDemo so we could debug. But for now, you have to debug on your side.

Never seen this reported by others I remember.

@pmairoldi
Copy link
Collaborator

since we have no plans to officially support swift 3.0 with chart 2.x we should close all issues related to it and delete the branch to avoid confusion.

@madhikarma
Copy link
Author

Makes sense, I thought it was worth trying the branch to keep the same Charts API but gain Swift 3.0 support.

I was able to patch the crash above with a NaN check inside the method but several more crashes occurred in other methods with the data set we were using so we stopped.

The same data set with the v2.3.0 Swift 2.3 branch https://github.com/danielgindi/Charts/tree/v2.3.0 did not crash so we migrated to Swift 2.3 instead until Charts 3.0 Swift 3.0 is finalised.

@pmairoldi
Copy link
Collaborator

Glad to hear you got things working. If you want charts 3.0 sooner you can always help closing the remaining issues 😉

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

3 participants