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 am trying to show horizontal bar chart with two datasets and but when I run my code with shows the only text of lines but lines are not visible. I can see text animate but no lines.
This is my code: chartView.noDataTextColor = .orange chartView.chartDescription?.text = "" let dataSet = getDataSet(budget: totalBudget, spending: totalSpend) let chartData = BarChartData(dataSets: dataSet) chartData.setValueTextColor(.white) chartView.data = chartData
This is my getDataSet Method:
func getDataSet(budget: Double, spending: Double) -> [BarChartDataSet] {
var budgetEntryList = [BarChartDataEntry]()
let budgetEntry = BarChartDataEntry(x: budget, y: budget)
budgetEntryList.append(budgetEntry)
let budgetDataSet = BarChartDataSet(values: budgetEntryList, label: "Total Budget")
budgetDataSet.setColor(.orange)
var spendingEntryList = [BarChartDataEntry]()
let spendEntry = BarChartDataEntry(x: spending, y: spending)
spendingEntryList.append(spendEntry)
let spendingDataSet = BarChartDataSet(values: spendingEntryList, label: "Total Spending")
spendingDataSet.setColor(.green)
return [budgetDataSet,spendingDataSet]
}
The text was updated successfully, but these errors were encountered:
I am trying to show horizontal bar chart with two datasets and but when I run my code with shows the only text of lines but lines are not visible. I can see text animate but no lines.
This is my code:
chartView.noDataTextColor = .orange
chartView.chartDescription?.text = ""
let dataSet = getDataSet(budget: totalBudget, spending: totalSpend)
let chartData = BarChartData(dataSets: dataSet)
chartData.setValueTextColor(.white)
chartView.data = chartData
This is my getDataSet Method:
func getDataSet(budget: Double, spending: Double) -> [BarChartDataSet] {
The text was updated successfully, but these errors were encountered: