annotation(position:alignment:spacing:content:)
Annotates this mark or collection of marks with a view positioned relative to its bounds.
Declaration
nonisolated func annotation<C>(position: AnnotationPosition = .automatic, alignment: Alignment = .center, spacing: CGFloat? = nil, @ViewBuilder content: @escaping (AnnotationContext) -> C) -> some ChartContent where C : View
Parameters
- position:
The location relative to the item being annotated at which the annotation will be placed.
- alignment:
The guide for aligning the annotation in the specified position.
- spacing:
Distance between the annotation and the annotated content, or
nilif you want to use the default distance. - content:
A view builder that creates the annotation.