<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Charts",
  "identifier" : "/documentation/Charts/AxisValueLabel/init(centered:anchor:multiLabelAlignment:collisionResolution:offsetsMarks:orientation:horizontalSpacing:verticalSpacing:content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Swift Charts"
    ],
    "preciseIdentifier" : "s:6Charts14AxisValueLabelV8centered6anchor05multiD9Alignment19collisionResolution12offsetsMarks11orientation17horizontalSpacing08verticalO07contentACyxGSbSg_7SwiftUI9UnitPointVSgAO0H0VSgAA0bcd9CollisionJ0VAnA0bcD11OrientationV14CoreFoundation7CGFloatVSgA1_xyXEtcfc"
  },
  "title" : "init(centered:anchor:multiLabelAlignment:collisionResolution:offsetsMarks:orientation:horizontalSpacing:verticalSpacing:content:)"
}
-->

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

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

```
nonisolated init(centered: Bool? = nil, anchor: UnitPoint? = nil, multiLabelAlignment: Alignment? = nil, collisionResolution: AxisValueLabelCollisionResolution = .automatic, offsetsMarks: Bool? = nil, orientation: AxisValueLabelOrientation = .automatic, horizontalSpacing: CGFloat? = nil, verticalSpacing: CGFloat? = nil, @ViewBuilder content: () -> Content)
```

## Parameters

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

`content`

The label content.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)