TimeScale
public class TimeScale : ScaleTime scale for temporal data.
Constructors
Section titled “Constructors”
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 |
Methods
Section titled “Methods”
SetDomain(DateTime, DateTime)
Section titled “SetDomain(DateTime, DateTime)”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
SetPreferredUnit(TimeUnit)
Section titled “SetPreferredUnit(TimeUnit)”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
Map(float)
Section titled “Map(float)”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
Map(DateTime)
Section titled “Map(DateTime)”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
Invert(float)
Section titled “Invert(float)”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
InvertToDate(float)
Section titled “InvertToDate(float)”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
GenerateTicks(int)
Section titled “GenerateTicks(int)”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[]
GenerateTickLabels(int, string)
Section titled “GenerateTickLabels(int, string)”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[]
Properties
Section titled “Properties”
DomainMinDate
Section titled “DomainMinDate”public DateTime DomainMinDate { get; }Returns
System.DateTime
DomainMaxDate
Section titled “DomainMaxDate”public DateTime DomainMaxDate { get; }Returns
System.DateTime