Class: OrdinalTimeScale
Defined in: scales/scale.ts:193
An ordinal time axis — the standard financial x-axis. Bars are plotted at evenly-spaced integer indices 0..n-1 (like CategoricalScale, so the domain is the band [-0.5, n-1+0.5]), which collapses market gaps (weekends, overnight, holidays) instead of leaving blank space the way a real TimeScale would. Each index carries a timestamp; ticks are placed at natural calendar boundaries (day / month / year, or hour / minute when zoomed in) and subsampled toward the target count, so labels stay readable at any zoom.
Plot your candles/bars at x = 0,1,2,… and pass the per-bar epoch-ms times.
Implements
Constructors
Constructor
new OrdinalTimeScale(times?): OrdinalTimeScale;Defined in: scales/scale.ts:198
Parameters
| Parameter | Type | Default value |
|---|---|---|
times | ArrayLike<number> | [] |
Returns
OrdinalTimeScale
Properties
domain
domain: Range;Defined in: scales/scale.ts:197
Implementation of
log
readonly log: false = false;Defined in: scales/scale.ts:195
Implementation of
times
times: number[];Defined in: scales/scale.ts:196
type
readonly type: "ordinal-time" = "ordinal-time";Defined in: scales/scale.ts:194
Implementation of
Methods
formatTick()
formatTick(value): string;Defined in: scales/scale.ts:281
Default label formatter for a tick value.
Parameters
| Parameter | Type |
|---|---|
value | number |
Returns
string
Implementation of
invert()
invert(t): number;Defined in: scales/scale.ts:207
Parameters
| Parameter | Type |
|---|---|
t | number |
Returns
number
Implementation of
norm()
norm(value): number;Defined in: scales/scale.ts:203
Parameters
| Parameter | Type |
|---|---|
value | number |
Returns
number
Implementation of
ticks()
ticks(target?): Tick[];Defined in: scales/scale.ts:218
Auto ticks appropriate for this scale type.
Parameters
| Parameter | Type | Default value |
|---|---|---|
target | number | 6 |
Returns
Tick[]