---
title: "valueAligned(xUnit:yMatching:xMajorAlignment:yMajorAlignment:limitBehavior:)"
framework: charts
role: symbol
role_heading: Type Method
path: "charts/chartscrolltargetbehavior/valuealigned(xunit:ymatching:xmajoralignment:ymajoralignment:limitbehavior:)"
---

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

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

## Declaration

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

## Parameters

- `xUnit`: The alignment unit for the x-axis.
- `yComponents`: The alignment components 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.
