I have this bar chart, it has some formatting issues:
I'd like to address these:
- there's strange numbers inside the bars. They could disappear, that would be quite happy.
- there's also strange, but different numbers above the bars. These could be the actual number.
- the chart label "recent Apps Data" could look more primary (bigger, bold-italic for example)
- the dates in the x-axis are .. kinda close. Not sure how to handle that one.
here's how I'm drawing these:
func setBarChart (data: [(String,[Double])], label: String, xLabels: [String]) {
var entries: [BarChartDataEntry] = []
for (index, tuple) in data.enumerated() {
entries.append(BarChartDataEntry(x: Double(index), yValues: tuple.1))
}
let set = BarChartDataSet(values: entries, label: DataViewController.constants.labelDate)
set.setColor(UIColor.orange)
let data = BarChartData(dataSets: [set])
barChart.data = data
barChart.chartDescription?.text = label
barChart.xAxis.valueFormatter = IndexAxisValueFormatter(values: xLabels)
barChart.xAxis.granularity = 1
let legendEntry = LegendEntry()
legendEntry.formColor = UIColor.orange
legendEntry.label = "mean performance"
barChart.legend.setCustom(entries: [legendEntry]);
barChart.notifyDataSetChanged()
}