---
title: "annotation(position:alignment:spacing:overflowResolution:content:)"
framework: charts
role: symbol
role_heading: Instance Method
path: "charts/chartcontent/annotation(position:alignment:spacing:overflowresolution:content:)-6w4p3"
---

# annotation(position:alignment:spacing:overflowResolution:content:)

Annotates this mark or collection of marks with a view positioned relative to its bounds.

## Declaration

```swift
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

- [annotation(position:alignment:spacing:content:)](charts/chartcontent/annotation(position:alignment:spacing:content:)-65emh.md)
- [annotation(position:alignment:spacing:content:)](charts/chartcontent/annotation(position:alignment:spacing:content:)-26b2f.md)
- [annotation(position:alignment:spacing:overflowResolution:content:)](charts/chartcontent/annotation(position:alignment:spacing:overflowresolution:content:)-1kiow.md)
