willdale / SwiftUICharts

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

TouchOverlay breaks LineStyle with ignoreZero flag #90

Closed krin-san closed 3 years ago

krin-san commented 3 years ago

I wanted to draw a time-based graph which always has 24 points. For that I'm filling out missing points (from current time till the rest of the day) with zeroes and set LineStyle.ignoreZero: true. Unexpectedly for me, when inspecting graph data with TouchOverlay and FloatingInfoBox modifiers and hovering over zero points, selection marker jumps down to zero and graph starts drawing both line and dots on Y-level 0.

I expected TouchOverlay to respect ignoreZero value and not drawing a marker on the line if it goes to ignored 0 points.

Screenshot 2021-06-11 at 09 25 49
Demo videos

https://user-images.githubusercontent.com/2318002/121649194-9e9f1e80-ca98-11eb-91e1-2b7f4cefcf93.mov https://user-images.githubusercontent.com/2318002/121649201-a068e200-ca98-11eb-8576-9f1b623388ce.mov

willdale commented 3 years ago

I'll have a look.