<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Charts",
  "identifier" : "/documentation/Charts/ValueAlignedChartScrollTargetBehavior/init(unit:majorAlignment:limitBehavior:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Swift Charts"
    ],
    "preciseIdentifier" : "s:6Charts37ValueAlignedChartScrollTargetBehaviorV4unit14majorAlignment05limitG0ACx_AA05MajorbJ0VyxGSgAA0bc5LimitG0VtcAA9PlottableRzSjRzlufc"
  },
  "title" : "init(unit:majorAlignment:limitBehavior:)"
}
-->

# init(unit:majorAlignment:limitBehavior:)

Creates a scroll target behavior that aligns to values spaced at regular intervals along the scrollable axes.

```
nonisolated init<T>(unit: T, majorAlignment: MajorValueAlignment<T>? = nil, limitBehavior: ValueAlignedLimitBehavior = .automatic) where T : Plottable, T : Numeric
```

## Parameters

`unit`

The alignment unit. When the user finishes a scroll gesture, the chart will snap to align to
the given unit or the end of the domain.

`majorAlignment`

The behavior for aligning to major values. When the user swipes on the chart, the chart will snap to the
next or previous major unit depending on the swipe direction. When enabled, the default major unit is a page.

`limitBehavior`

The scroll limit behavior.

---

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)