---
title: "init(_:centered:anchor:multiLabelAlignment:collisionResolution:offsetsMarks:orientation:horizontalSpacing:verticalSpacing:)"
framework: charts
role: symbol
role_heading: Initializer
path: "charts/axisvaluelabel/init(_:centered:anchor:multilabelalignment:collisionresolution:offsetsmarks:orientation:horizontalspacing:verticalspacing:)-9202h"
---

# init(_:centered:anchor:multiLabelAlignment:collisionResolution:offsetsMarks:orientation:horizontalSpacing:verticalSpacing:)

Constructs an axis value label with the given properties to display the given string.

## Declaration

```swift
nonisolated init(_ titleKey: LocalizedStringKey, centered: Bool? = nil, anchor: UnitPoint? = nil, multiLabelAlignment: Alignment? = nil, collisionResolution: AxisValueLabelCollisionResolution = .automatic, offsetsMarks: Bool? = nil, orientation: AxisValueLabelOrientation = .automatic, horizontalSpacing: CGFloat? = nil, verticalSpacing: CGFloat? = nil) where Content == Text
```

## Parameters

- `titleKey`: A title generated from a localized string.
- `centered`: Whether to center the label between two axis values. If nil, default to true for discrete data, false to continuous data.
- `anchor`: The anchor point on the bounding box of the text element that attaches to the position.
- `multiLabelAlignment`: How labels along the axis are aligned with each other.
- `collisionResolution`: How labels that collide with others are resolved.
- `offsetsMarks`: Whether to offset marks to accomodate for the space used by the label.
- `orientation`: The orientation of the label.
- `horizontalSpacing`: The horizontal spacing of the label. If nil, a default spacing will be used.
- `verticalSpacing`: The vertical spacing of the label.
