You can use the chartYAxis / chartXAxis modifiers specifying AxisMarks without any AxisGridLines or AxisTicks. Or set them with a clear foreground color.
Chart{
BarMark(x: .value("o", 5),
y: .value("m", "Duration: 5m"),
width: 7)
.foregroundStyle(.orange)
BarMark(x: .value("o", 7),
y: .value("m", "Intervals: 7"),
width: 7)
.foregroundStyle(.teal)
}
.chartYAxis {
AxisMarks(position: .leading) { _ in
AxisValueLabel()
}
}
.chartXAxis {
AxisMarks(position: .bottom) { _ in
// AxisGridLine().foregroundStyle(.clear)
// AxisTick().foregroundStyle(.clear)
AxisValueLabel()
}
}