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
This issue was addressed in January as a bug , and it is yet to be resolved.
I am trying to add 2 PieChartDataSets to my PieChartView, but I keep running into the issue where one of the datasets unfolds as a nil when the renderer is creating the Legend object.
Here is my code (I know its super ugly but its a dummy project)
Here is a link to the same addressed issue - #2099
func setChart() {
for value in stocks1 {
let entry = PieChartDataEntry()
entry.y = Double(value.amount)
entry.label = value.name
dataEntries1.append(entry)
}
for value in stocks2 {
let entry = PieChartDataEntry()
entry.y = Double(value.amount)
entry.label = value.name
dataEntries2.append(entry)
}
var colors1: [UIColor] = []
var colors2: [UIColor] = []
for _ in 0..<stocks1.count {
let red = Double(arc4random_uniform(256))
let green = Double(arc4random_uniform(256))
let blue = Double(arc4random_uniform(256))
let color = UIColor(red: CGFloat(red/255), green: CGFloat(green/255), blue: CGFloat(blue/255), alpha: 1)
colors1.append(color)
}
for _ in 0..<stocks2.count {
let red = Double(arc4random_uniform(256))
let green = Double(arc4random_uniform(256))
let blue = Double(arc4random_uniform(256))
let color = UIColor(red: CGFloat(red/255), green: CGFloat(green/255), blue: CGFloat(blue/255), alpha: 1)
colors2.append(color)
}
let set1 = ChartDataSet(values: dataEntries1, label: "Companies")
let set2 = ChartDataSet(values: dataEntries2, label: "Companies2")
let data1 = PieChartData(dataSets: [set1, set2])
set1.colors = colors1
set2.colors = colors2
pieChartView.data = data1
}
The text was updated successfully, but these errors were encountered:
Hello,
This issue was addressed in January as a bug , and it is yet to be resolved.
I am trying to add 2 PieChartDataSets to my PieChartView, but I keep running into the issue where one of the datasets unfolds as a nil when the renderer is creating the Legend object.
Here is my code (I know its super ugly but its a dummy project)
Here is a link to the same addressed issue - #2099
func setChart() {
The text was updated successfully, but these errors were encountered: