You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to implement a simple bar chart. I've instantiated the data like so:
let chartView = BarChartView(frame: chartContainer.bounds)
let data = (0..<10).map { (i) -> BarChartDataEntry in
return BarChartDataEntry(x: Double(i), y: Double.random(in: 1..<10))
}
let dataset: BarChartDataSet = BarChartDataSet(data)
let chartData: BarChartData = BarChartData(dataSets: [dataset])
guard (chartData.dataSets.first as? IBarChartDataSet) != nil else {
print("WTF???")
return
}
chartView.data = chartData
What did you expect to happen?
I expect that there is not a crash when the chart is loaded.
What happened instead?
There is a crash inside BarChartRenderer-initBuffers on line 76:
let set = barData.dataSets[i] as! IBarChartDataSet
For some reason, the dataset no longer conforms to IBarChartDataSet when it reaches this point.
I have also checked immediately after initializing the BarChartData, and it's already broken there:
let dataset: BarChartDataSet = BarChartDataSet(data)
let chartData: BarChartData = BarChartData(dataSets: [dataset])
// this guard passes: dataset is an IBarChartDataSet
guard (dataset as? IBarChartDataSet) != nil else {
return
}
// this one fails. shouldn't it be the same?
guard (chartData.dataSets.first as? IBarChartDataSet) != nil else {
print("WTF???")
return
}
Charts Environment
Charts version/Branch/Commit Number: 3.0/master/e850593 Xcode version: 10.2.1 Swift version: 5.0 Platform(s) running Charts: iOS macOS version running Xcode: 10.14.5
The text was updated successfully, but these errors were encountered:
What did you do?
I'm attempting to implement a simple bar chart. I've instantiated the data like so:
What did you expect to happen?
I expect that there is not a crash when the chart is loaded.
What happened instead?
There is a crash inside BarChartRenderer-initBuffers on line 76:
For some reason, the dataset no longer conforms to IBarChartDataSet when it reaches this point.
I have also checked immediately after initializing the BarChartData, and it's already broken there:
Charts Environment
Charts version/Branch/Commit Number: 3.0/master/e850593
Xcode version: 10.2.1
Swift version: 5.0
Platform(s) running Charts: iOS
macOS version running Xcode: 10.14.5
The text was updated successfully, but these errors were encountered: