willdale / SwiftUICharts

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

Negative Values going out of frame/bounds (BarCharts) #148

Closed kunalverma25 closed 2 years ago

kunalverma25 commented 2 years ago

For both Horizontal and vertical bar charts, negative value bars are drawn out of the frame. If the horizontal chart is full width or vertical chart is full height then negative bars will be drawn out of the screen.

Eg - Screenshot 2021-12-16 at 11 10 05 AM

kunalverma25 commented 2 years ago

This is because of scaleEffect doesn't change the frame. Any idea how to fix this?

kunalverma25 commented 2 years ago

@willdale Any fix for this?

kunalverma25 commented 2 years ago

Even with baseline set properly, the bar chart does not respect that and starts drawing only from the axis itself rather than the value. Even though added lines are working perfectly.

Screenshot 2021-12-24 at 10 39 32 AM

willdale commented 2 years ago

I'll look in to this in V3

willdale commented 2 years ago

Thanks for your PR.