现在,当我尝试设置动态数据时,我已将组合图与Charts库一起使用,然后此处遇到的Xaxis值对齐问题将附加所有属性,因为我已经在代码中设置了但无法正常工作。
func initialChartSetup()
{
let xAxisValue = chartView.xAxis
xAxisValue.valueFormatter = axisFormatDelegate
xAxisValue.labelPosition = XAxis.LabelPosition.bottom
xAxisValue.drawGridLinesEnabled = false
xAxisValue.granularityEnabled = true
xAxisValue.granularity = 1
xAxisValue.spaceMin = 0.5
xAxisValue.spaceMax = 0.5
xAxisValue.forceLabelsEnabled = true
xAxisValue.labelTextColor = UIColor.white
xAxisValue.labelCount = 6
chartView.leftAxis.axisMinimum = 0
chartView.leftAxis.labelTextColor = UIColor.white
chartView.leftAxis.gridColor = NSUIColor.clear
chartView.rightAxis.drawLabelsEnabled = false
chartView.legend.enabled = false
chartView.doubleTapToZoomEnabled = false
chartView.pinchZoomEnabled = false
}