Skip to content

LinearScale

ClassChartGuruChartGuru
public class LinearScale : Scale

Linear scale with uniform mapping.

public LinearScale(float domainMin = 0, float domainMax = 1, float rangeMin = 0, float rangeMax = 1)

Creates a uniformly interpolated numeric scale between the input domain and output range.

Parameters

NameType
domainMinSystem.Single
domainMaxSystem.Single
rangeMinSystem.Single
rangeMaxSystem.Single

public override float Map(float value)

Maps a value from the scale’s input domain into its configured output range.

Parameters

NameType
valueSystem.Single

Returns

System.Single

public override float Invert(float position)

Reverses the axis mapping so larger values are laid out toward the opposite edge.

Parameters

NameType
positionSystem.Single

Returns

System.Single

public override float[] GenerateTicks(int count)

Generates readable tick values spanning the active domain, targeting the requested count without exceeding scale constraints.

Parameters

NameType
countSystem.Int32

Returns

System.Single[]

public LinearScale Nice(int tickCount = 10)

Compute “nice” round numbers for domain bounds.

Parameters

NameType
tickCountSystem.Int32

Returns

ChartGuru.LinearScale