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

Line chart crashes with a big float #62

Closed
turkenh opened this issue May 2, 2015 · 8 comments
Closed

Line chart crashes with a big float #62

turkenh opened this issue May 2, 2015 · 8 comments

Comments

@turkenh
Copy link

turkenh commented May 2, 2015

I am drawing line chart with one yVal = 657711616 and xVal="SomeText"
But app crashes at following line:

screen shot 2015-05-02 at 3 59 26 am

Previously, just before I updated to recent commits, app was crashing for same chart but with an error:

Assertion failed: (CGFloatIsValid(x) && CGFloatIsValid(y)), function void CGPathMoveToPoint(CGMutablePathRef, const CGAffineTransform *, CGFloat, CGFloat), file Paths/CGPath.cc, line 254.

@danielgindi
Copy link
Collaborator

It crashes because x/y are NaN, and NaN can't be cast to Int.
The question is - why is viewPortHandler full of NaNs?

Did you initialize with a null frame or something?

@danielgindi
Copy link
Collaborator

@PhilJay do you think we should move everything to work with doubles? Seems like people have already exhausted all numeric possibilities with float ;-)

@PhilJay
Copy link
Collaborator

PhilJay commented May 2, 2015

Yes I think we could.
It's gonna be significant effort, but doable :-)

@danielgindi
Copy link
Collaborator

It's just "ant work" as we say in Hebrew, just changing a lot of floats to
double, and of course float literals like 0.f to 0.0... Yeah a lot of work!

On Sat, May 2, 2015 at 8:45 PM, Philipp Jahoda notifications@github.com
wrote:

Yes I think we could.
It's gonna be significant effort, but doable :-)


Reply to this email directly or view it on GitHub
#62 (comment)
.

@turkenh
Copy link
Author

turkenh commented May 2, 2015

Yes, I aggree that double would be better:)
But unfortunately I need a quick fix right now:(
So, I prepared a minimal working example with exactly same data. It draws the chart with a small float, i.e. 100 but crashes with the one that I mentioned above.
Could you please check it and advise me about what am I doing wrong? or a workaround if this is really a bug?

https://github.com/turkenh/ios-chart-crash

Thanks...

@danielgindi
Copy link
Collaborator

For the next version we will be ready with Doubles instead of Floats, so that will be relatively soon...

@danielgindi
Copy link
Collaborator

@PhilJay are you going to move MPAndroidCharts to Double? Do you want my help?

@PhilJay
Copy link
Collaborator

PhilJay commented Jun 2, 2015

Yes I am definitely planning on doing so, I just don't have the time right now. If you want to start this just let me know so that we don't start simultaneously :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants