protocol AXChartDescriptorRepresentable
AXChartDescriptor
object that you use to provide information about a chart and its data for an accessible experience in VoiceOver or other assistive technologies.Availability 有効性
Technology
func accessibilityChartDescriptor<R>(_ representable: R) -> some View
where R : AXChartDescriptorRepresentable
chartDescriptor
The AXChart
used to describe your chart and its data.
Use this method to provide information about your chart view to allow VoiceOver and other assistive technology users to perceive and interact with your chart and its data.
This may be applied to any View that represents a chart, including Image and custom-rendered chart views.
The accessibility
modifier can be applied to -any- view representing a chart, the simplest case being just an image of a chart. The implementation details of the view aren’t important, only the fact that it represents a chart, and that the provided chart descriptor accurately describes the content of the chart.
Example usage:
First define your AXChart
type.
struct MyChartDescriptorRepresentable: AXChartDescriptorRepresentable { func makeChartDescriptor() -> AXChartDescriptor { // build and return your AXChart
here }
func updateChartDescriptor(_ descriptor: AXChartDescriptor) {
// Update your chart descriptor with any new values, or
// don't override if your chart doesn't have changing values.
}
}
Then use the accessibility
modifier to provide an instance of your AXChart
type to the view representing your chart:
SomeChartView() .accessibilityChartDescriptor(MyChartDescriptorRepresentable())
protocol AXChartDescriptorRepresentable
AXChartDescriptor
object that you use to provide information about a chart and its data for an accessible experience in VoiceOver or other assistive technologies.