Skip to content

IScaleTransformer

InterfaceChartGuruChartGuru
public interface IScaleTransformer

Pluggable axis scale transformer. Swift Charts equivalent: ScaleTransformer (used by ChartXScale(transformer:) / ChartYScale(transformer:)).

When an AxisConfig.CustomScaleTransformer is assigned, it overrides the built-in AxisScaleType branches inside AxisConfig.TransformValue(float) / AxisConfig.InverseTransformValue(float). Implementations must be deterministic, allocation-free, and have Inverse(Forward(x)) ≈ x across the working domain.

float Forward(float value)

Map a raw data value into transformed (axis-coordinate) space.

Parameters

NameType
valueSystem.Single

Returns

System.Single

float Inverse(float transformed)

Inverse of IScaleTransformer.Forward(float).

Parameters

NameType
transformedSystem.Single

Returns

System.Single

float[] SuggestTicks(float rawMin, float rawMax, int desiredCount)

Optional tick suggestion for non-uniform scales. May return null to fall back to the built-in linear tick generator (which the engine will run against the transformed domain). When non-null, the values are interpreted in raw data space.

Parameters

NameType
rawMinSystem.Single
rawMaxSystem.Single
desiredCountSystem.Int32

Returns

System.Single[]