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

Most upvoted comments

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