Swift Charts animation woes using centered AxisValueLabel

Hi,

I'm having some trouble when animating my chart with a custom AxisValueLabel. Specifically, as soon as I set its init parameter centered to true, the x axis' leftmost value of the previous dataset sticks around during the animation to the next dataset.

Here's a GIF of a screen recording from a minimum reproducible example I built. Keep a close eye on the x axis of the third BarMark, and notice how the 0 from the first BarMark sticks around longer than necessary / intended. While it isn't visible in the GIF, the extra 0 eventually does disappear, but only after the transition if fully complete, making the animation feel distracting and amateur-ish, rather than smooth.

This is my code for the x axis. If I turn centered to false, this problem immediately goes away.

.chartXAxis {
    AxisMarks(
        preset: .aligned,
        values: .stride(
            by: .day,
            count: 1,
            calendar: .current
        )
    ) { value in
        AxisValueLabel(centered: true) {
            Text("\(value.index)")
            }
        }
    }

As you might be able to tell, my x axis is date based, and I'm working on showing one BarMark per day of the week.

I have a ZIP of my minimum reproducible example that I can provide for anyone interested, although I don't know how to share it here.

Any advice on what I can do to fix this?

@antonmedstorta You could file a Feedback Request via Feedback Assistant and include the focused sample project.

Once you do, please post the Feedback ID here.

Done! FB13888781.

Swift Charts animation woes using centered AxisValueLabel
 
 
Q