Contents

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: () -> 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 nil if you want to use the default distance.

  • content:

    A view builder that creates the annotation. The builder takes one input which provides information regarding the item being annotated such as its size.

See Also

Annotating marks