I was struggling with this as well. I was able to solve this by setting AxisValueLabel's anchor to top.
.chartXAxis {
AxisMarks(position: .bottom, values: .stride(by: .hour, count: 3)) { _ in
AxisGridLine()
AxisValueLabel(format: .dateTime.hour(), anchor: .top)
}
}
Topic:
App & System Services
SubTopic:
Core OS
Tags: