Ich verwende Charts API und Implementierungsdiagramm. Ich bin neu darin und es gibt keine richtige Dokumentation für Swift 3.Balkendiagramm gibt negative Werte
Ich habe versucht und implementiert, aber ich weiß nicht, wie Sie diese negative Skala für y entfernen. Wie kann ich mein Diagramm nur von 0 starten, so dass es keine negative y-Skala zeigt?
Unten ist mein Code:
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)
}.
Image:
Ich versuchte das, aber nicht geholfen. Ich habe barChartView.xAxis.axisMinValue = 0.5 – kishor0011
hast du irgendeine Lösung dafür? –
versuchen Sie dies barChartView.leftAxis.axisMinimum = 0 –