Skip to content

TimeScale

ClassChartGuruChartGuru
public class TimeScale : Scale

Time scale for temporal data.

TimeScale(DateTime, DateTime, float, float)

Section titled “TimeScale(DateTime, DateTime, float, float)”
public TimeScale(DateTime domainMin, DateTime domainMax, float rangeMin = 0, float rangeMax = 1)

Creates a temporal scale whose numeric domain is elapsed seconds from the supplied start date.

Parameters

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

public TimeScale SetDomain(DateTime min, DateTime max)

Replaces the date interval and rebuilds its elapsed-seconds domain from the new start date.

Parameters

NameType
minSystem.DateTime
maxSystem.DateTime

Returns

ChartGuru.TimeScale

public TimeScale SetPreferredUnit(TimeUnit unit)

Sets the preferred calendar unit used when formatting and generating temporal ticks.

Parameters

NameType
unitChartGuru.TimeUnit

Returns

ChartGuru.TimeScale

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 float Map(DateTime value)

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

Parameters

NameType
valueSystem.DateTime

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 DateTime InvertToDate(float position)

Maps an output-range coordinate back to a date in the scale’s configured time domain.

Parameters

NameType
positionSystem.Single

Returns

System.DateTime

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 string[] GenerateTickLabels(int count, string format = null)

Generates formatted labels for readable tick values spanning the active time domain.

Parameters

NameType
countSystem.Int32
formatSystem.String

Returns

System.String[]

public DateTime DomainMinDate { get; }

Returns

System.DateTime

public DateTime DomainMaxDate { get; }

Returns

System.DateTime