我正在使用 Charts API 并实现图表。我是新手,没有适用于 Swift 3 的适当文档。
我尝试并实施了,但不知道如何消除 y 的负比例。如何仅从 0 开始我的图表,所以它不显示负 y 刻度?
下面是我的代码:
fileprivate func ChartViewProperty() {
barChartView.xAxis.labelPosition = .bottom
barChartView.chartDescription?.text = ""
barChartView.fitBars = true
barChartView.pinchZoomEnabled = false
self.barChartView.rightAxis.enabled = false
barChartView.animate(xAxisDuration: 2.0, yAxisDuration: 2.0)
barChartView.animate(xAxisDuration: 2.0, yAxisDuration: 2.0, easingOption: .easeInBounce)
barChartView.xAxis.valueFormatter = IndexAxisValueFormatter(values:months)
barChartView.xAxis.granularity = 1
value.append([jan,feb,mar,apr,may,jun,jly,aug,sep,oct,nov,dec])
setChart(dataPoints: months, values: value)
}.
图片: