Skip to content

StackedBarChart animation starts from mid-height instead of zero #258

@H-CLo

Description

@H-CLo

Hi, thank you for this great charting library!

I'm using StackedBarChart in a SwiftUI app to display quarterly sales, and noticed that when the chart animates on appearance, the bars do not grow from the baseline (y = 0). Instead, the animation starts from around the mid-height of the chart.

This behavior can be seen in the attached screenshot. Based on the documentation and expected behavior, I believe the animation should start from the bottom of the chart (i.e. from zero) and grow upward.

Environment:
Xcode: 16.3
iOS Simulator: 18.2
SwiftUICharts: 2.10.3

Steps to reproduce:
1. Clone the SwiftUICharts demo app.
2. Copy the StackedBarChart example code into a new SwiftUI project.
3. Run the app on a physical device or simulator.
4. Observe that when the view appears, the bars animate from around the vertical center of the chart instead of from the bottom (0.0).

Expected behavior:
The bar animation should originate from the bottom (0.0) of the chart area.

Screenshot:
Image

Let me know if you need a minimal reproducible example. I'd be happy to provide code.

Thanks again for your work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions