1
私は2つのデータセットを持つ次の折れ線グラフを持っています。 1つのデータセットは左側のyAxに依存し、他方のデータセットは右側のyAxisに依存する。ios-chartsを使用して、同じ行に左右の軸を揃える方法は?
ここでは、両方とも同じ行にゼロの値を設定します。 他の値は整列されていません。 どうすればいいですか?あなたが持っているので
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は、質問にコードを追加しました –