... and now it works again. The phone was disconnected and when I connected it to gather the sysdiagnose the code works as it should. Maybe something restarted the "helper application". Yesterday I did probably 30 tests and nothing worked. If/when it appears again I'll do the feedback.
Post
Replies
Boosts
Views
Activity
Aha, when googling for freezes when using that modifier I found: https://stackoverflow.com/questions/77236097/swift-charts-chartxvisibledomain-hangs-or-crashes. The docs here are really bad, they had me believing that the value was the number of visible bars. Maybe someone should fix that and also add an example where the units really matter. But the whole thing should of course not freeze when the value is not ideal. In my case I have one bar for each hour and I show about 36 hours of data. The X axis comes from a Date. So setting a value of 10 here means that the visible area is 10 seconds. A better value 36000 which is 10 hours and which gives about 10 visible bars.
In theory that does work maybe kind of in some cases. I did test it myself at some point and it did kind of work, but as soon as I add chartXVisibleDomain to my real app it freezes. If I remove that line it works ok but the chart is as buggy as ever. Any tested value causes it to freeze as soon as the chart should be shown (by default the chart that's buggy is in a second tab in a TabView). Freezes both in the simulator and on device.
By now I could have created my bar chart from scratch instead of fighting with this buggy mess.