-
-
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
(v3.0 + Swift3.0)LineChart crash when dataSets is a empty array #1491
Comments
Try with latest master, there's a commit from a few hours ago that is supposed to fix that |
@danielgindi |
master -> Charts 3.0 |
This is fixed now due to another issue that has pointed out the source of the issue (#1511) |
I'm at the head of master branch, but still crash.. |
I can confirm that the fix does NOT work. Stepping through the code, I can see that the Number value
results in making i = infinity and then
goes on to crash the app. Why the initial number value is the max double value is beyond me though. |
@danielgindi reopened |
This issue is still at large. You can see the illegal conversion on this line (it tries to convert it to an Int inside the call to roundToNextSignificant): |
If anyone is looking for a workaround for this without patching, just set custom axis min and max before setting the data on the chart, i.e.:
|
We're seeing this only when the chart is zoomed and we empty the data. Setting the above axisMin/Max to (0,10) respectively, worked, but then you'd need to disable this custom min/max later. Since our issue only happens when zoomed, we found that zooming out bypassed the crash. However, resetZoom() doesn't seem to work. Instead, we use:
|
in v2.x, when LineChart's dataSets is a empty array it will show a charts with no line, but v3.0 will crash.
error info:
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: