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.
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.
Readonly typeGet 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 ticks formatting function of this TimeTickStrategy object.
Formatting Function.
Get minor ticks formatting function of this TimeTickStrategy object.
Formatting Function.
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.
Utility method for setting formatting function of all numeric tick levels (major, minor) as well as cursor.
Each formatting target can be individually overridden with following methods:
New TimeTickStrategy object.
Function that formats a tick value to text.
Set major ticks formatting function of this TimeTickStrategy object.
New TimeTickStrategy object.
Formatting function to use with this TimeTickStrategy object.
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 TickStyle object or a function, which creates a new one based on the existing style.
Set minor ticks formatting function of this TimeTickStrategy object.
New TimeTickStrategy object.
Formatting function to use with this TimeTickStrategy object.
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: TickStyle ) => 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.
This is a convenience function which simultaneously applies both setMajorTickStyle and setMinorTickStyle.
New NumericTickStrategy object.
Either a TickStyle 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 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:001 000->00:00:013 600 000->01:00:001->00:00:00.0010.001->00:00:00.000001Axis 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.