Skip to main content

Class TimeScale

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

Projects temporal values (DateTimeOffset) using linear mapping in Unix milliseconds.

public sealed class TimeScale : IScale<DateTimeOffset>, IScale

Inheritance

objectTimeScale

Implements

IScale<DateTimeOffset>, IScale

Inherited Members

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

Constructors

TimeScale(DateTimeOffset, DateTimeOffset, bool)

public TimeScale(DateTimeOffset start, DateTimeOffset end, bool clampToDomain = true)

Parameters

start DateTimeOffset

end DateTimeOffset

clampToDomain bool

TimeScale(Range<DateTimeOffset>, bool)

public TimeScale(Range<DateTimeOffset> domain, bool clampToDomain = true)

Parameters

domain Range<DateTimeOffset>

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<DateTimeOffset> Domain { get; }

Property Value

Range<DateTimeOffset>

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(DateTimeOffset)

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

public double Project(DateTimeOffset value)

Parameters

value DateTimeOffset

Returns

double

TryProject(DateTimeOffset, out double)

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

public bool TryProject(DateTimeOffset value, out double unit)

Parameters

value DateTimeOffset

unit double

Returns

bool

Unproject(double)

Converts a normalized unit value back into domain space.

public DateTimeOffset Unproject(double unit)

Parameters

unit double

Returns

DateTimeOffset