Skip to main content

Class LinearScale

Namespace: VelloSharp.Charting.Scales
Assembly: VelloSharp.Charting.dll

Projects numeric values using a linear mapping.

public sealed class LinearScale : IScale<double>, IScale

Inheritance​

object ← LinearScale

Implements​

IScale<double>, IScale

Inherited Members​

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors​

LinearScale(double, double, bool)​

public LinearScale(double start, double end, bool clampToDomain = true)

Parameters​

start double

end double

clampToDomain bool

LinearScale(Range<double>, bool)​

public LinearScale(Range<double> domain, bool clampToDomain = true)

Parameters​

domain Range<double>

clampToDomain bool

Properties​

ClampToDomain​

Gets a value indicating whether inputs are clamped to the domain when projected.

public bool ClampToDomain { get; }

Property Value​

bool

Domain​

Gets the scale domain range.

public Range<double> Domain { get; }

Property Value​

Range<double>

DomainType​

Gets the underlying domain value type.

public Type DomainType { get; }

Property Value​

Type

Kind​

Gets the scale family.

public ScaleKind Kind { get; }

Property Value​

ScaleKind

Methods​

Project(double)​

Projects the provided value into normalized unit space (0..1).

public double Project(double value)

Parameters​

value double

Returns​

double

TryProject(double, out double)​

Attempts to project the provided value into unit space without throwing.

public bool TryProject(double value, out double unit)

Parameters​

value double

unit double

Returns​

bool

Unproject(double)​

Converts a normalized unit value back into domain space.

public double Unproject(double unit)

Parameters​

unit double

Returns​

double