Skip to content

FunctionScaleTransformer

ClassChartGuruChartGuru
public sealed class FunctionScaleTransformer : IScaleTransformer

Convenience: build an IScaleTransformer from delegates.

FunctionScaleTransformer(Func<float, float>, Func<float, float>, Func<float, float, int, float[]>)

Section titled “FunctionScaleTransformer(Func<float, float>, Func<float, float>, Func<float, float, int, float[]>)”
public FunctionScaleTransformer(Func<float, float> forward, Func<float, float> inverse, Func<float, float, int, float[]> ticks = null)

Creates a custom scale from conversion delegates. Missing forward or inverse delegates become identity transforms; tick suggestions remain optional.

Parameters

NameType
forwardSystem.Func{System.Single,System.Single}
inverseSystem.Func{System.Single,System.Single}
ticksSystem.Func{System.Single,System.Single,System.Int32,System.Single[]}

public float Forward(float value)

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

Parameters

NameType
valueSystem.Single

Returns

System.Single

public float Inverse(float transformed)

Inverse of IScaleTransformer.Forward(float).

Parameters

NameType
transformedSystem.Single

Returns

System.Single

public 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[]