I'm adding a new chart and hit a strange Swift Charts issue.
If the Y-axis data is all zeros then the Y-axis gets flipped!
Specifying a chartYScale seems to be the solution.
.chartYScale(domain: 0...(yValues.last ?? 1), type: .linear)
And here is the blog post with some background information on the app.
I'm adding a new chart and hit a strange Swift Charts issue.
If the Y-axis data is all zeros then the Y-axis gets flipped!
Specifying a chartYScale seems to be the solution.
.chartYScale(domain: 0...(yValues.last ?? 1), type: .linear)
Just published a deep dive on how I built interactive timelines in Viatza using Swift Charts — medicine bars, symptom lanes, tap + drag selection, and a few SwiftUI surprises along the way.
If you’re working with charts or health data, hope it helps 🌿
Comments welcome.
#SwiftUI #SwiftCharts #iOSDev #IndieDev #BuildInPublic #Viatza
I wrote a blog post about the improvements I made to @PleaseDontRain based on feedback from my WWDC accessibility lab.
I didn't expect it to involve time zones! ⏰
Beyond Linear: Using MeshGradient in Swift Charts
https://www.sgade.de/blog/2025-05-26-meshgradient-in-swift-charts/
I just wrote an addendum to the blog post I wrote recently about struggling to find an answer to a Swift Charts problem I was having.
It was a night and day difference with the next issue I encountered.
Swift Charts lets you manually choose what color is used for each category in the legend but it doesn't appear that you can manually choose what shapes appear in it.
I made my own legend to use when differentiate without color is active.
I think that I'm done with this new feature!
I created an example in my accessibility settings for @PleaseDontRain to show how I'm differentiating without color for my bar charts.
Really happy with how this turned out!
I've done some more experimenting and now I'm leaning towards tiny basic shapes above each bar instead of using letters to differentiate without color.
The legend hasn't been addressed yet.
Spent some time experimenting with @bas and we couldn't get visual patterns to appear in bars via Swift Charts to differentiate without color.
I filed feedback FB17599628 as a suggestion.