One Logo Pool Ball
Charts · IOS API REFERENCE

ValueAlignedChartScrollTargetBehavior

struct · iOS 17.0+ · SDK 27.1

struct ValueAlignedChartScrollTargetBehavior

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

Members (7)

method · iOS 17.0+

updateTarget

TypeScript
updateTarget(target: _SwiftUICore_ScrollTarget, context: ChartScrollTargetBehaviorContext): { $ret: null; $out: { "target": _SwiftUICore_ScrollTarget } }
Swift declaration
func updateTarget(_ target: inout ScrollTarget, context: ChartScrollTargetBehaviorContext)

Omit the output parameters from the call. The result contains $ret and $out, with target inside $out.

init · iOS 17.0+

init

TypeScript
static initUnitMajorAlignmentLimitBehavior(unit: number, majorAlignment?: (MajorValueAlignment<number>) | null, limitBehavior?: ValueAlignedLimitBehavior): ValueAlignedChartScrollTargetBehavior
Swift declaration
nonisolated init<T>(unit: T, majorAlignment: MajorValueAlignment<T>? = nil, limitBehavior: ValueAlignedLimitBehavior = .automatic) where T : Plottable, T : Numeric

Creates a scroll target behavior that aligns to values spaced at regular intervals along the scrollable axes. - Parameter 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. - Parameter 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. - Parameter limitBehavior: The scroll limit behavior.

init · iOS 17.0+

init

TypeScript
static initXUnitYUnitXMajorAlignmentYMajorAlignmentLimitBehavior(xUnit: number, yUnit: number, xMajorAlignment?: (MajorValueAlignment<number>) | null, yMajorAlignment?: (MajorValueAlignment<number>) | null, limitBehavior?: ValueAlignedLimitBehavior): ValueAlignedChartScrollTargetBehavior
Swift declaration
nonisolated init<X, Y>(xUnit: X, yUnit: Y, xMajorAlignment: MajorValueAlignment<X>? = nil, yMajorAlignment: MajorValueAlignment<Y>? = nil, limitBehavior: ValueAlignedLimitBehavior = .automatic) where X : Plottable, X : Numeric, Y : Plottable, Y : Numeric

Creates a scroll target behavior that aligns to values spaced at regular intervals along the scrollable axes. - Parameter xUnit: The alignment unit for the x-axis. - Parameter yUnit: The alignment unit for the y-axis. - Parameter xMajorAlignment: The behavior for aligning to major values along the x-axis. - Parameter yMajorAlignment: The behavior for aligning to major values along the y-axis. - Parameter limitBehavior: The scroll limit behavior.

init · iOS 17.0+

init

TypeScript
static initXUnitYMatchingXMajorAlignmentYMajorAlignmentLimitBehavior(xUnit: number, yComponents: _Foundation_DateComponents, xMajorAlignment?: (MajorValueAlignment<number>) | null, yMajorAlignment?: (MajorValueAlignment<globalThis.Date>) | null, limitBehavior?: ValueAlignedLimitBehavior): ValueAlignedChartScrollTargetBehavior
Swift declaration
nonisolated init<X>(xUnit: X, yMatching yComponents: DateComponents, xMajorAlignment: MajorValueAlignment<X>? = nil, yMajorAlignment: MajorValueAlignment<Date>? = nil, limitBehavior: ValueAlignedLimitBehavior = .automatic) where X : Plottable, X : Numeric

Creates a scroll target behavior that aligns to values spaced at regular intervals along the scrollable axes. - Parameter xUnit: The alignment unit for the x-axis. - Parameter yComponents: The alignment components for the y-axis. - Parameter xMajorAlignment: The behavior for aligning to major values along the x-axis. - Parameter yMajorAlignment: The behavior for aligning to major values along the y-axis. - Parameter limitBehavior: The scroll limit behavior.

init · iOS 17.0+

init

TypeScript
static initMatchingMajorAlignmentLimitBehavior(components: _Foundation_DateComponents, majorAlignment?: (MajorValueAlignment<globalThis.Date>) | null, limitBehavior?: ValueAlignedLimitBehavior): ValueAlignedChartScrollTargetBehavior
Swift declaration
nonisolated init(matching components: DateComponents, majorAlignment: MajorValueAlignment<Date>? = nil, limitBehavior: ValueAlignedLimitBehavior = .automatic)

Creates a scroll target behavior that aligns to values spaced at regular intervals along the scrollable axes. - Parameter components: The components to search for when aligning after the user finishes scrolling. - Parameter 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. - Parameter limitBehavior: The scroll limit behavior.

init · iOS 17.0+

init

TypeScript
static initXMatchingYMatchingXMajorAlignmentYMajorAlignmentLimitBehavior(xComponents: _Foundation_DateComponents, yComponents: _Foundation_DateComponents, xMajorAlignment?: (MajorValueAlignment<globalThis.Date>) | null, yMajorAlignment?: (MajorValueAlignment<globalThis.Date>) | null, limitBehavior?: ValueAlignedLimitBehavior): ValueAlignedChartScrollTargetBehavior
Swift declaration
nonisolated init(xMatching xComponents: DateComponents, yMatching yComponents: DateComponents, xMajorAlignment: MajorValueAlignment<Date>? = nil, yMajorAlignment: MajorValueAlignment<Date>? = nil, limitBehavior: ValueAlignedLimitBehavior = .automatic)

Creates a scroll target behavior that aligns to values spaced at regular intervals along the scrollable axes. - Parameter xComponents: The alignment components for the x-axis. - Parameter yComponents: The alignment components for the y-axis. - Parameter xMajorAlignment: The behavior for aligning to major values along the x-axis. - Parameter yMajorAlignment: The behavior for aligning to major values along the y-axis. - Parameter limitBehavior: The scroll limit behavior.

init · iOS 17.0+

init

TypeScript
static initXMatchingYUnitXMajorAlignmentYMajorAlignmentLimitBehavior(xComponents: _Foundation_DateComponents, yUnit: number, xMajorAlignment?: (MajorValueAlignment<globalThis.Date>) | null, yMajorAlignment?: (MajorValueAlignment<number>) | null, limitBehavior?: ValueAlignedLimitBehavior): ValueAlignedChartScrollTargetBehavior
Swift declaration
nonisolated init<Y>(xMatching xComponents: DateComponents, yUnit: Y, xMajorAlignment: MajorValueAlignment<Date>? = nil, yMajorAlignment: MajorValueAlignment<Y>? = nil, limitBehavior: ValueAlignedLimitBehavior = .automatic) where Y : Plottable, Y : Numeric

Creates a scroll target behavior that aligns to values spaced at regular intervals along the scrollable axes. - Parameter xComponents: The alignment components for the x-axis. - Parameter yUnit: The alignment unit for the y-axis. - Parameter xMajorAlignment: The behavior for aligning to major values along the x-axis. - Parameter yMajorAlignment: The behavior for aligning to major values along the y-axis. - Parameter limitBehavior: The scroll limit behavior.

Skipped declarations

No declarations were skipped in this snapshot.

All Charts types →