I created a SwiftChart as below and I would like to have two YAxis, one for amount and the second for count. So, the amount YAxis is a different scale then the count YAxis. Does anybody have an example of this or shed some light on coding two different YAxis?
Thanks
ForEach(seriesArt) { series in
ForEach(series.chartSeries.chartEntry) {
BarMark(
x: .value("Tier", $0.tier),
y: .value("Price", $0.keyValue)
)
}
.foregroundStyle(by: .value("Count", series.chartCategory))
.position(by: .value("Price", series.chartCategory))
}
}
.frame(width: 400, height: 200)
.chartXAxis {
AxisMarks(position: .bottom, values: .automatic) {
AxisValueLabel()
.foregroundStyle(Color.white)
}
}
.chartYAxis {
AxisMarks(position: .leading, values: .automatic) { value in
AxisGridLine(centered: true, stroke: StrokeStyle(lineWidth: 1))
AxisValueLabel() {
if let intValue = value.as(Int.self) {
Text("\(intValue)")
.font(.system(size: 10))
.foregroundColor(.white)
}
}
}
.chartYAixs - for count sum by tier which needs to be a different scale from the amount YAxis
}
}
}