<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Swift Charts"
    ],
    "preciseIdentifier" : "s:6Charts25ChartScrollTargetBehaviorP"
  },
  "title" : "ChartScrollTargetBehavior"
}
-->

# ChartScrollTargetBehavior

A type that configures the scroll behavior of charts.

```
protocol ChartScrollTargetBehavior : ScrollTargetBehavior
```

## Topics

### Supporting types

[`struct MajorValueAlignment`](/documentation/Charts/MajorValueAlignment)

A type that defines how the valigned aligned chart scroll target behavior aligns to major values on swipe.

[`struct ValueAlignedLimitBehavior`](/documentation/Charts/ValueAlignedLimitBehavior)

A type that defines the amount of marks that can be scrolled at a time.

[`struct ValueAlignedChartScrollTargetBehavior`](/documentation/Charts/ValueAlignedChartScrollTargetBehavior)

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

### Instance Methods

[`func updateTarget(inout ScrollTarget, context: ChartScrollTargetBehaviorContext)`](/documentation/Charts/ChartScrollTargetBehavior/updateTarget(_:context:))

### Type Methods

[`static func valueAligned(matching: DateComponents, majorAlignment: MajorValueAlignment<Date>?, limitBehavior: ValueAlignedLimitBehavior) -> ValueAlignedChartScrollTargetBehavior`](/documentation/Charts/ChartScrollTargetBehavior/valueAligned(matching:majorAlignment:limitBehavior:))

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

[`static func valueAligned<P>(unit: P, majorAlignment: MajorValueAlignment<P>?, limitBehavior: ValueAlignedLimitBehavior) -> ValueAlignedChartScrollTargetBehavior`](/documentation/Charts/ChartScrollTargetBehavior/valueAligned(unit:majorAlignment:limitBehavior:))

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

[`static func valueAligned(xMatching: DateComponents, yMatching: DateComponents, xMajorAlignment: MajorValueAlignment<Date>?, yMajorAlignment: MajorValueAlignment<Date>?, limitBehavior: ValueAlignedLimitBehavior) -> ValueAlignedChartScrollTargetBehavior`](/documentation/Charts/ChartScrollTargetBehavior/valueAligned(xMatching:yMatching:xMajorAlignment:yMajorAlignment:limitBehavior:))

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

[`static func valueAligned<Y>(xMatching: DateComponents, yUnit: Y, xMajorAlignment: MajorValueAlignment<Date>?, yMajorAlignment: MajorValueAlignment<Y>?, limitBehavior: ValueAlignedLimitBehavior) -> ValueAlignedChartScrollTargetBehavior`](/documentation/Charts/ChartScrollTargetBehavior/valueAligned(xMatching: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>(xUnit: X, yMatching: DateComponents, xMajorAlignment: MajorValueAlignment<X>?, yMajorAlignment: MajorValueAlignment<Date>?, limitBehavior: ValueAlignedLimitBehavior) -> ValueAlignedChartScrollTargetBehavior`](/documentation/Charts/ChartScrollTargetBehavior/valueAligned(xUnit:yMatching: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>?, yMajorAlignment: MajorValueAlignment<Y>?, limitBehavior: ValueAlignedLimitBehavior) -> ValueAlignedChartScrollTargetBehavior`](/documentation/Charts/ChartScrollTargetBehavior/valueAligned(xUnit:yUnit:xMajorAlignment:yMajorAlignment:limitBehavior:))

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

### Default Implementations

[ScrollTargetBehavior Implementations](/documentation/Charts/ChartScrollTargetBehavior/ScrollTargetBehavior-Implementations)

## Relationships

### Inherits From

[`ScrollTargetBehavior`](/documentation/SwiftUI/ScrollTargetBehavior)

### Conforming Types

[`ValueAlignedChartScrollTargetBehavior`](/documentation/Charts/ValueAlignedChartScrollTargetBehavior)

---

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)