I understood that I have to use the following line but I don't know how to use it in SwiftUI : chart.xAxis.forceLabelsEnabled = true
Here is my charts :
var sampleData: [Int] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
Chart {
ForEach(sampleData.indices, id: \.self) { index in
BarMark(x: .value("x", String(Calendar.current.monthSymbols[index].prefix(3))),
y: .value("y", index))
}
}
.chartYAxis(.hidden)
.frame(height: 180)
In french, June = Juin and July = Juillet.
As the first 3 letters of JUIN and JUILLET are the same then the fusion values. One of the solutions is to put .prefix(4)
but that's not what I want