<!--
{
  "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/ChartScrollTargetBehavior/valueAligned(xUnit:yUnit:xMajorAlignment:yMajorAlignment:limitBehavior:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Swift Charts",
      "Charts"
    ],
    "preciseIdentifier" : "s:6Charts25ChartScrollTargetBehaviorPAAE12valueAligned5xUnit01yH015xMajorAlignment01yiJ005limitE0AA05ValuegbcdE0Vqd___qd_0_AA0ilJ0Vyqd__GSgAMyqd_0_GSgAA0lg5LimitE0VtAKRszAA9PlottableRd__SjRd__AaTRd_0_SjRd_0_r0_lFZ"
  },
  "title" : "valueAligned(xUnit:yUnit:xMajorAlignment:yMajorAlignment:limitBehavior:)"
}
-->

# valueAligned(xUnit:yUnit:xMajorAlignment:yMajorAlignment:limitBehavior:)

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

```
static func valueAligned<X, Y>(xUnit: X, yUnit: Y, xMajorAlignment: MajorValueAlignment<X>? = nil, yMajorAlignment: MajorValueAlignment<Y>? = nil, limitBehavior: ValueAlignedLimitBehavior = .automatic) -> ValueAlignedChartScrollTargetBehavior where Self == ValueAlignedChartScrollTargetBehavior, X : Plottable, X : Numeric, Y : Plottable, Y : Numeric
```

## Parameters

`xUnit`

The alignment unit for the x-axis.

`yUnit`

The alignment unit for the y-axis.

`xMajorAlignment`

The behavior for aligning to major values along the x-axis.

`yMajorAlignment`

The behavior for aligning to major values along the y-axis.

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