Contents

annotation(position:alignment:spacing:overflowResolution: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, overflowResolution: AnnotationOverflowResolution, @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 nil if you want to use the default distance.

  • overflowResolution:

    How to resolve the annotation exceeding the boundary of the plot.

  • content:

    A view builder that creates the annotation.

See Also

Annotating marks