"font" and "foregroundstyle" modifier on AxisValueLabel don't work!

Hi,

I use a barmark/linemark SwiftUI chart in my app and when i want to change the fontsize and color of the AxisValueLabel for the x-axis then it does not seem to work properly. When i set the following:

AxisValueLabel()
.foregroundStyle(.red)

or

AxisValueLabel()
.font(.system(size: 30))

it doesn't show up.

Kind regards,

Tom

I had the same problem with both .foregroundStyle and .font.

My workaround was:

AxisValueLabel {
    Text(String(format: "%.2f", value.as(Double.self) ?? 0))
        .foregroundColor(.red)
}
"font" and "foregroundstyle" modifier on AxisValueLabel don't work!
 
 
Q