我想使用不渲染任何 x 轴或网格线的 ios-charts 渲染(堆叠)水平条形图。我已经禁用了我能找到的所有设置,但底部的 x 轴仍然呈现。
func setUpBarChart() {
// General bar chart settings
barChart.pinchZoomEnabled = false
barChart.drawGridBackgroundEnabled = false
barChart.drawBarShadowEnabled = false
barChart.drawValueAboveBarEnabled = false
barChart.drawBordersEnabled = false
barChart.drawMarkers = false
barChart.legend.enabled = false
barChart.descriptionText = ""
barChart.drawBordersEnabled = false
// Left-axis settings
barChart.leftAxis.drawLabelsEnabled = false
barChart.leftAxis.drawTopYLabelEntryEnabled = false
barChart.leftAxis.drawAxisLineEnabled = false
// x-axis settings
barChart.xAxis.drawAxisLineEnabled = false
barChart.xAxis.drawGridLinesEnabled = false
barChart.xAxis.drawLabelsEnabled = false
barChart.xAxis.enabled = false
// add some dummy data
let entry = BarChartDataEntry(values: [10,2,5], xIndex: 0)
let set = BarChartDataSet(yVals: [entry], label: nil)
set.colors = [UIColor.greenColor(), UIColor.yellowColor(), UIColor.redColor()]
set.drawValuesEnabled = false
let data = BarChartData(xVals: [""], dataSet: set)
barChart.data = data
}
此代码导致以下渲染:
如何删除底轴渲染和垂直值线?