I am trying to setup a simple stacked bar chart using iOS Chart.
the examples all show looping though data - I just want to write one entry straight into the code.
I am crashing at the: let set = BarChartDataSet.
Error is:
Cannot convert value of type 'BarChartDataEntry' to expected argument type '[ChartDataEntry]?'
func _costChart( comm: Double, margin: Double, expense: Double) {
let yVals = BarChartDataEntry(x: 0.0, yValues: [comm, margin, expense ], icon: #imageLiteral(resourceName: "icon"))
let set = BarChartDataSet(entries: yVals, label: "")
let data = BarChartData(dataSets: set)
costChart.data = data
}
How can I write this to confirm to the proper format?