willdale / SwiftUICharts

A charts / plotting library for SwiftUI. Works on macOS, iOS, watchOS, and tvOS and has accessibility features built in.
MIT License
837 stars 103 forks source link

Animations in FilledLineChart are not aligned!!!! #238

Open danaabhi opened 1 year ago

danaabhi commented 1 year ago

FilledLineChart(chartData: segmentationSelection == .week ? weekData : todayData)

                .filledTopLine(chartData: segmentationSelection == .week ? weekData : todayData,
                               lineColour: ColourStyle(colour: .orange),

                               strokeStyle: StrokeStyle(lineWidth: 3))

                .xAxisLabels(chartData: segmentationSelection == .week ? weekData : todayData)
                .id(segmentationSelection == .week ? weekData.id : todayData.id)
                .frame(minWidth: 150, maxWidth: 900, minHeight: 150, idealHeight: 300, maxHeight: 300, alignment: .center)

we are having the following code in which the animation for gradient and line is not matching, whenever we start the app, the gradient appears first then slowly the line comes from bottom to top.

Also is there a way to make the animation start from center