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

Name Type
domainMin System.DateTime
domainMax System.DateTime
rangeMin System.Single
rangeMax System.Single

public TimeScale SetDomain(DateTime min, DateTime max)

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

Parameters

Name Type
min System.DateTime
max System.DateTime

Returns

ChartGuru.TimeScale

public TimeScale SetPreferredUnit(TimeUnit unit)

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

Parameters

Name Type
unit ChartGuru.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

Name Type
value System.Single

Returns

System.Single

public float Map(DateTime value)

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

Parameters

Name Type
value System.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

Name Type
position System.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

Name Type
position System.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

Name Type
count System.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

Name Type
count System.Int32
format System.String

Returns

System.String[]

public DateTime DomainMinDate { get; }

Returns

System.DateTime

public DateTime DomainMaxDate { get; }

Returns

System.DateTime