willdale / SwiftUICharts

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

Update How VoiceOver Announces Grouped Bar Charts #221

Closed dadederk closed 1 year ago

dadederk commented 1 year ago

Using the contain option for the .accessibilityElement(children: ) modifier. with an accessibility label. That way, the first time that the focus moves to one of the elements in the chart, the title of the chart will be announced preceding the accessibility label and value for the bar. Update the bars so it announces the title for the group of the data point instead of the title of the chart every time.

This way, it seems to be a bit less redundant and it provides instead important information, to what legend item corresponds each one of the bars.

Before:

https://user-images.githubusercontent.com/2143610/188285605-f8741f77-77e8-49b0-ad39-76da27dec4fa.MP4

After:

https://user-images.githubusercontent.com/2143610/188285665-944635b8-27b2-4691-b6d6-6614a37e9df1.MP4