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

Negative Number Height of Bar Makes Transparent Color #234

Open owenzhao opened 1 year ago

owenzhao commented 1 year ago

This issue was first mentioned by myself on https://github.com/willdale/SwiftUICharts/issues/218. I file it again as in Xcode 14, I could not use 2.10.0 as workaround. In Xcode 14, 2.10.0 crashed.

So is that possible not use makes the color working with Negative Number Height of Bar?

Xcode 14.3 (14E222b) macOS Ventura 13.3.1 (a) (22E772610a) SwiftUICharts 2.10.2

tolteste commented 5 months ago

experiencing the same issue, have you found a workaround?

owenzhao commented 5 months ago

experiencing the same issue, have you found a workaround?

For higher version of macOS(13+), you can try the native Charts framework. And still use 2.10.0 for the lower version.

tolteste commented 5 months ago

Sadly we have to support iOS 15+ so we can't use native Charts. I've fixed the version to 2.10.0 and it's displaying negative values.

owenzhao commented 5 months ago

Sadly we have to support iOS 15+ so we can't use native Charts. I've fixed the version to 2.10.0 and it's displaying negative values.

You can use them together. With something like

if #available(macOS 14.0, *)
//SwiftUI native charts
else 
this charts