1
我有以下2个数据集的折线图。 一个数据集依赖于左边的yAxis,右边的yAxis。如何使用ios图表在同一行中对齐左右轴?
现在我想让他们都在同一行中有零值。 其他值可以不对齐。 我该怎么做?
代码:
let speedLine = LineChartDataSet(values: speedEntries, label: "Speed")
speedLine.colors = [UIColor.white]
speedLine.drawCirclesEnabled = false
speedLine.axisDependency = .left
let powerLine = LineChartDataSet(values: powerEntries, label: "Power")
powerLine.colors = [UIColor.green]
powerLine.drawCirclesEnabled = false
powerLine.axisDependency = .right
let data = LineChartData()
data.addDataSet(speedLine)
data.addDataSet(powerLine)
chartView.data = data
chartView.xAxis.labelTextColor = UIColor.white
chartView.xAxis.labelCount = 20
chartView.leftAxis.labelTextColor = UIColor.white
chartView.rightAxis.labelTextColor = UIColor.green
chartView.legend.textColor = UIColor.white
chartView.rightAxis.axisMinimum = -80.0
chartView.chartDescription?.text = ""
你可以分享你的代码?然后它将有可能重现问题 – DevB2F
@ DevB2F完成,将代码添加到问题 –