Charts: Index out of bounds exception in v3.2 in createAccessibleElement
After updating to charts 3.2 I started getting Fatal error: Index out of range in the new BarChartRenderer#createAccessibleElement():809. It seems this code dataSet.stackLabels[idx % stackSize] makes stackLabels required?
My workaround for now is to always specify stackLabels. Can be done with something like this:
let dataSet = BarChartDataSet(values: entries, label: nil)
dataSet.stackLabels = [String](repeating: "", count: dataSet.stackSize)
Charts Environment
Charts version: 3.2 Xcode version: 10 Swift version: 4.2 Platform: iOS macOS: 10.13.6
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 5
- Comments: 19 (7 by maintainers)
Commits related to this issue
- close #3659: fix index out of bounds issue when using stacked bar chart — committed to shineeth/Charts by pmairoldi 6 years ago
- Merge commit 'f2795b9813e7e8c2bcdac3f4c3cc74790116999e' into refactoring/swift-4.2 * commit 'f2795b9813e7e8c2bcdac3f4c3cc74790116999e': (108 commits) Remove delegate method call for translation whe... — committed to MobileTradingPartnersLLP/ios-charts by deleted user 5 years ago
- Update from original repo (#2) * Avoid passing NaN to CoreGraphics API (Fixes #1626) * Added delegate callback to detect when panning is finished, to potentially allow users to manually reset the ... — committed to leandropjp/Charts by leandropjp 5 years ago
- Danielgindi master (#5) * Avoid passing NaN to CoreGraphics API (Fixes #1626) * Added delegate callback to detect when panning is finished, to potentially allow users to manually reset the hightli... — committed to leandropjp/Charts by leandropjp 5 years ago
- fixed stacked chart bug when there are different stacks on columns. (#4029) fix #3659 * fixed stacked chart bug when there are different stacks on columns. * added empty array check — committed to SwiftPolar/Charts by Scalman 5 years ago
- fixed stacked chart bug when there are different stacks on columns. (#4029) fix #3659 * fixed stacked chart bug when there are different stacks on columns. * added empty array check — committed to RobertChalmers/Charts by Scalman 5 years ago
Problably the end of the week. I’ll see if I have time tomorrow. Please keep in mind that we are all just volunteering our time here.
It was a while ago but i did found some time to fix the issue. @liuxuan30 @petester42 could one of review the small change i did. plz