Protocol

AXChartDescriptorRepresentable

A type to generate an AXChartDescriptor object that you use to provide information about a chart and its data for an accessible experience in VoiceOver or other assistive technologies.

Declaration 宣言

protocol AXChartDescriptorRepresentable

Overview 概要

Note that you may use the @Environment property wrapper inside the implementation of your AXChartDescriptorRepresentable, in which case you should implement updateChartDescriptor, which will be called when the Environment changes.

For example, to provide accessibility for a view that represents a chart, you would first declare your chart descriptor representable type:

struct MyChartDescriptorRepresentable: AXChartDescriptorRepresentable { func makeChartDescriptor() -> AXChartDescriptor { // build and return your AXChartDescriptor here }


   func updateChartDescriptor(_ descriptor: AXChartDescriptor) {
       // update your chart descriptor with any new values
   }

}

Then, provide an instance of your AXChartDescriptorRepresentable type to your view using the accessibilityChartDescriptor modifier:

var body: some View { MyChartView() .accessibilityChartDescriptor(MyChartDescriptorRepresentable()) }

Topics 話題

Instance Methods インスタンス メソッド

See Also 参照

Charts