-
-
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
Array index out of range when removing entries from DataSet #203
Comments
Ok I changed my code to this because I realized what I was doing wrong before, but it's still crashing with the same error NSInteger count = [self.currentBarChartDataSet entryCount];
for (int i = 0; i < count; i++) {
[self.currentBarChartDataSet removeEntryWithXIndex:0];
// [self.pastBarChartDataSet removeEntryWithXIndex:i];
} |
It's crashing on this line #395 in ChartDataSet.swift |
Call notifyDataSetChanged() after done changing the data On Fri, Jul 10, 2015 at 6:50 PM, Brandon Shega notifications@github.com
|
It doesn't even let me get that far, it's crashing before it even moves over the line where the entry is removed. |
try to fix wrong position bug. use entry.xIndex instead of j of dataSet.entryCount to calculate the offset and position apply the same logic for getMarkerPosition add fix for horizontal bar chart merge from upstream master Wrong demo navigation title Maximum negative value was confused... Removed unused code startAtZeroEnabled killed that range when all values are negative Bound check for horizontal bars was wrong (Fixed issue ChartsOrg#211) Fixed a crash when removing an entry (Fixed issue ChartsOrg#203) Removed redundant calls Inverted axis mode taken care of in stacked bars Added back the 3rd dataset in demo project Bumped to 2.1.1 Improvements to stacked bars Major improvements to Highlights Improvements concerning value-drawing in barcharts. Improvements and bugfixes concerning highlighting. Fix ChartMarker position for stacked-bars Removed redundant function Feature to allow forcing YAxis label-count Bumped to 2.1.2 CONTRIBUTING.md You will now see this when creating new issues. Ha ha!
Is there a specific reason why I am getting
fatal error: Array index out of range:
with this code?I'm basically trying to remove all data from the bar chart in
prepareForReuse
in aUICollectionViewCell
so that the chart isn't visible when the collection view is reloaded.If I log the count, it is 7 and the loop is running 7 times.
The text was updated successfully, but these errors were encountered: