-
-
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
Changing chart data + autoScaleMinMaxEnabled causes crash #1151
Comments
I noticed that start is derived from lowestVisibleXIndex. I've tried moving the chart to index 0 after setting data and still no luck. |
are you able to fix it? Seems like the calc here is wrong. What's the start and end value? Is it reproducible with ChartsDemo? If you can provide some code to reproduce with ChartsDemo, that's better. |
I might have to dig deeper. My finding is that the chart needs to be scrollable (so that it shows a subset of the data). After new data is set on the chart, it's hanging on to the old lowestVisibleXIndex (which might be greater than the number of items in the current chart) and not resetting it properly. |
I don't think any of the ChartsDemo examples are scrollable, are they? |
if you zoomed in, they are. You can turn on autoScaleMinMaxEnabled via options button in any chart view controller to see if you can reproduce |
I don't seem to be able to reproduce this on Charts 3.0, please check again on 3.0 and re-open the issue if it persists. |
In this particular project, I need to change my Chart's data following the pressing of a button.
I create a new dataset and set the chart's data this way:
When my chart has the property autoScaleMinMaxEnabled set to false, this works perfectly.
However, if this property is true, I get an error in func ChartDataSet.calcMinMax(start start: Int, end: Int) at the line:
Because start's value is greater than endValue.
Any ideas?
The text was updated successfully, but these errors were encountered: