Crash BarChartView(data: ChartData(points: [0,0,0,0])...
BarChartView(data: ChartData(points: [0,0,0,0]), title: "Start from Zero", legend: "Growing up") Not Empty, but zero Crash
Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]. Layer: <SwiftUI.GradientLayer:0x600001445f10; position = CGPoint (0 0); bounds = CGRect (0 0; 0 0); delegate = <_TtC7SwiftUIP33_A34643117F00277B93DEBAB70EC0697122_UIShapeHitTestingView: 0x7fd8a9629e80; frame = (-8.98847e+307 -8.98847e+307; 1.79769e+308 1.79769e+308); transform = [nan, nan, nan, nan, 0, 0]; anchorPoint = (0, 0); autoresizesSubviews = NO; layer = <SwiftUI.GradientLayer: 0x600001445f10>>; allowsGroupOpacity = YES; transform = CATransform3D (nan nan 0 0; nan nan 0 0; 0 0 1 0; 0 0 0 1); cornerRadius = 4; anchorPoint = CGPoint (0 0)>'
PR #109
I'm still getting this bug when passing a (String, Double) tuple as the data. My data is: [("0", 0.0), ("1", 0.0), ("2", 0.0), ("3", 0.0), ("4", 0.0), ("5", 0.0), ("6", 0.0), ("7", 0.0), ("8", 0.0), ("9", 0.0), ("10", 0.0), ("11", 0.0), ("12", 0.0), ("13", 0.0), ("14", 0.0), ("15", 0.0), ("16", 0.0), ("17", 0.0), ("18", 0.0), ("19", 0.0), ("20", 0.0), ("21", 0.0), ("22", 0.0), ("23", 0.0)] and I'm getting the same error.
I'm having a similar issue using the following:
BarChartView(data: ChartData(points: [1, 5, 4, 7, 2]), title: "")
Reading the diagnostics report provides this message:
Compiling failed: initializer 'init(points:)' requires that 'Int' conform to 'BinaryFloatingPoint'
And checking the source shows that the ChartData(points:) initializer does expect a number that conforms to BinaryFloatingPoint, despite the ReadMe stating that it should be used for integers.
Changing all the values to floating point numbers ([1.0, 5.0, 4.0, 7.0, 2.0]) allowed the program to build successfully.