Swift-Charts-Examples
Swift-Charts-Examples copied to clipboard
Sleep stages graph
I was implementing the Sleep Stages (Awake, REM, Core, Deep) graph using the BarMark. The plot matches that of the Apple's Health App, but I could not manage to put the connecting lines as shown in the Apple Health app. Can anybody tell me how to implement the connecting lines between Bar Marks.
No direct API is available in Swift Charts to get the lines easily - I asked Apple devs during one of the Ask Dev sessions and confirmed that it is impossible with the current API.
Although, I did something similar by drawing clip shapes over the RectangleMark
. See the effect here.
No direct API is available in Swift Charts to get the lines easily - I asked Apple devs during one of the Ask Dev sessions and confirmed that it is impossible with the current API. Although, I did something similar by drawing clip shapes over the
RectangleMark
. See the effect here.
@nonameplum Any chance you can share sample code for how you achieved this? I have been trying in a demo project but can't seem to figure it out.
Thanks!