-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
fatal error: Double value cannot be converted to Int because it is either infinite or NaN #1550
Comments
I am now checking array elements count before passing to Charts API as workaround. |
What double value are you passing? I'll write some test cases to try to fix this. |
@petester42 I was passing array of Double but array is empty. |
so |
|
Then my assumption would be that the function would never be called. Can you provide the snippit you use to create this chart so I can reproduce it in my environment? |
Previous: this produces fatal error when array is empty Current one with condition to avoid this fatal error
Function to set the graph datasets
|
Yup confirmed bug. Should be a simple fix. |
@petester42 Thanks for this update and will wait for the fix. |
fixed by #1558 |
I have found the solution to this. Just be careful with the implementation of this pod, specifically in this method: func setChart(dataPoints: [String], values: [Double]) { Here the new implementation: func setChart(_ dataPoints: [String], values: [Double]) { I was making a big mistake passing the "dataPoints" instead of the "chartDataSet" values. Obviously Xcode doesn´t show any error until you run your code. |
When I use LineChart APIs, I am getting fatal error at ChartUtils.swift @ line 53.
fatal error: Double value cannot be converted to Int because it is either infinite or NaN
The text was updated successfully, but these errors were encountered: