Skip to content

ChartScrollTargetBehavior

ClassChartGuruChartGuru
public abstract class ChartScrollTargetBehavior

Defines how scroll positions align to data values and how paging advances through a visible chart domain.

public static readonly ChartScrollTargetBehavior None

Disables snapping; scroll positions stay wherever callers set them.

Returns

ChartGuru.ChartScrollTargetBehavior

public static ChartScrollTargetBehavior ValueAligned(float step, float? majorAlignment = null)

Snaps scroll positions to the nearest multiple of step, optionally offset by majorAlignment (so stepping aligns to a chosen value).

Parameters

Name Type
step System.Single
majorAlignment System.Nullable{System.Single}

Returns

ChartGuru.ChartScrollTargetBehavior

ValueAligned(float, MajorValueAlignment, ValueAlignedLimitBehavior)

Section titled “ValueAligned(float, MajorValueAlignment, ValueAlignedLimitBehavior)”
public static ChartScrollTargetBehavior ValueAligned(float step, MajorValueAlignment majorAlignment, ValueAlignedLimitBehavior limit = ValueAlignedLimitBehavior.Automatic)

Snaps scroll positions using a configurable major-value alignment (unit, calendar matching, or page-sized) and limit behavior. Swift Charts equivalent: .valueAligned(matching:majorAlignment:limitBehavior:).

Parameters

Name Type
step System.Single
majorAlignment ChartGuru.MajorValueAlignment
limit ChartGuru.ValueAlignedLimitBehavior

Returns

ChartGuru.ChartScrollTargetBehavior

public static ChartScrollTargetBehavior Categories(IEnumerable<float> values)

Snaps to the nearest value in a sorted category list (useful for band axes).

Parameters

Name Type
values System.Collections.Generic.IEnumerable{System.Single}

Returns

ChartGuru.ChartScrollTargetBehavior

ValueAligned(float, float, float?, float?, ValueAlignedLimitBehavior)

Section titled “ValueAligned(float, float, float?, float?, ValueAlignedLimitBehavior)”
public static ChartScrollTargetBehavior ValueAligned(float xStep, float yStep, float? xMajorAlignment = null, float? yMajorAlignment = null, ValueAlignedLimitBehavior limit = ValueAlignedLimitBehavior.Automatic)

Two-axis value-aligned behavior. Snaps independently along X and Y to multiples of the per-axis steps (with optional per-axis major alignment). Swift Charts equivalent: .valueAligned(matchingX:majorAlignmentX:matchingY:majorAlignmentY:limitBehavior:).

Parameters

Name Type
xStep System.Single
yStep System.Single
xMajorAlignment System.Nullable{System.Single}
yMajorAlignment System.Nullable{System.Single}
limit ChartGuru.ValueAlignedLimitBehavior

Returns

ChartGuru.ChartScrollTargetBehavior

public abstract float Snap(float raw)

Projects raw onto the nearest valid scroll target.

Parameters

Name Type
raw System.Single

Returns

System.Single

public virtual float Snap(float raw, in ScrollTargetContext context)

Context-aware snap. Default implementation forwards to ChartGuru.ChartScrollTargetBehavior.Snap(System.Single); behaviors that need the visible Domain (e.g. MajorValueAlignment.Page) override this.

Parameters

Name Type
raw System.Single
context ChartGuru.ScrollTargetContext

Returns

System.Single

protected ChartScrollTargetBehavior()

public static ChartScrollTargetBehavior Paging { get; }

Paging scroll behavior: each settle snaps the leading edge by full ChartGuru.ScrollTargetContext.VisibleDomainLength increments. Swift Charts equivalent: .paging.

Returns

ChartGuru.ChartScrollTargetBehavior