Optional
values: Iterable<[string, unknown]> | Partial<TimeTickStrategyProperties>Readonly
cursorCursor formatter.
This controls the formatting used by:
TickStrategy
.Axis.formatValue
method of the Axis which uses this TickStrategy
.undefined
means to use default Time cursor formatting.
// Example value, custom cursor formatter
cursorFormatter: (value, range, locale) => value.toFixed(3)
Optional
Readonly
majorFormatting function used for major ticks.
Use FormattingFunctions to select available ones or define custom function.
undefined will result in default selection.
Readonly
majorStyle of Major ticks.
Major ticks can't be disabled (via emptyTicks), because TickLevel style doesn't support emptyTicks, and Major tick level must exist for minor tick positioning.
Optional
Readonly
minorFormatting function used for minor ticks.
Use FormattingFunctions to select available ones or define custom function.
undefined will result in default selection.
Readonly
minorStyle of Minor ticks.
To disable minor ticks, set to emptyTick.
Readonly
timeoptional "Time origin" value. If a timeOrigin is defined, data-points will instead be interpreted as milliseconds since timeOrigin.
Get cursor formatter of this TimeTickStrategy
object.
FormattingFunction
as set by user, or undefined
to indicate that the default time cursor formatting is configured.
Get major tick style of this TimeTickStrategy object.
Major tick style.
Set cursor formatter for this TimeTickStrategy
object.
This will override the date time formatting used by:
TickStrategy
.Axis.formatValue
method of the Axis which uses this TickStrategy
. // Example syntax, custom cursor formatting.
Axis.setTickStrategy(AxisTickStrategies.Time, (ticks) => ticks
.setCursorFormatter((value, range, locale) =>
value.toFixed(3)
)
)
New TimeTickStrategy object.
FormattingFunction
or undefined
to use default time cursor formatting.
Construct a new TimeTickStrategy object based on this one, but with modified major tick style.
Example usage:
Set font of major ticks:
Axis.setTickStrategy(
AxisTickStrategies.Time,
( tickStrategy: TimeTickStrategy ) => tickStrategy
.setMajorTickStyle(( tickStyle ) => tickStyle
.setLabelFont(( font ) => font
.setWeight( 'bold' )
)
)
)
New TimeTickStrategy object.
Either a VisibleTicks object or a function, which creates a new one based on the existing style.
Construct a new TimeTickStrategy object based on this one, but with modified minor tick style.
Example usage:
Disable minor ticks:
Axis.setTickStrategy(
AxisTickStrategies.Time,
( tickStrategy: TimeTickStrategy ) => tickStrategy
.setMinorTickStyle( emptyTick )
)
Set font of minor ticks:
Axis.setTickStrategy(
AxisTickStrategies.Time,
( tickStrategy: TimeTickStrategy ) => tickStrategy
.setMinorTickStyle(( tickStyle: VisibleTicks ) => tickStyle
.setLabelFont(( font ) => font
.setWeight( 'bold' )
)
)
)
New TimeTickStrategy object.
Either a TickStyle object or a function, which creates a new one based on the existing style. Passing a function only works if the existing style is not emptyTick.
Construct a new TimeTickStrategy object based on this one, but with modified timeOrigin.
If a timeOrigin is defined, data-points will instead be interpreted as milliseconds since timeOrigin.
Example usage:
Application with 24 hour time origin offset:
Axis.setTickStrategy(AxisTickStrategies.Time,
(tickStrategy) => tickStrategy.setTimeOrigin(24 * 60 * 60 * 1000)
)
New TimeTickStrategy object.
Millisecond offset or undefined
to disable time origin offsetting.
Axis Tick Strategy that is designed for depicting time ranges between hundreds of hours to individual nanoseconds.
Axis values are interpreted as milliseconds, for example:
0
->00:00:00
1 000
->00:00:01
3 600 000
->01:00:00
1
->00:00:00.001
0.001
->00:00:00.000001
Axis interval ranges supported by
TimeTickStrategy
:0.0001
).8 640 000 000
)Note, that available axis interval ranges can be also limited by the type of Axis, refer to Axis documentation for more information.
Axis tick strategy is selected with setTickStrategy method:
All configuration of automatically created ticks is done using the callback from
setTickStrategy
, see example below for the idea:All available strategies for automatic Axis ticks creation can be referenced via AxisTickStrategies.