Skip to content

LogScale

ClassChartGuruChartGuru
public class LogScale : Scale

Logarithmic scale for exponential data.

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

Creates a base-10 logarithmic scale, replacing non-positive domain bounds with safe positive defaults.

Parameters

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

public LogScale SetBase(float logBase)

Sets the logarithm base used for mapping, inversion, and tick generation.

Parameters

NameType
logBaseSystem.Single

Returns

ChartGuru.LogScale

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

Remarks

Like Swift Charts, a logarithmic scale draws a tick at every power of its base in the domain, whatever the count.