Hierarchy

  • TimeTickStrategyProperties

Properties

cursorFormatter: undefined | FormattingFunction

Cursor formatter.

This controls the formatting used by:

  • Default cursor result table formatters.
  • Default cursor tick formatters along Axis which uses this 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)
customTickPlacement: undefined | CustomTickPlacementLogic | Record<"major" | "minor", CustomTickPlacementLogic>

Allows specifying custom logic, overriding where axis ticks are placed.

This logic can either be specified:

  • For 1 tick level only (major ticks generally). In this case, minor ticks or other tick levels are not shown.
  • For each tick level separately (i.e. major & minor)
 // Example, control major tick placement only
chart.axisY.setTickStrategy(AxisTickStrategies.Numeric, (strategy) =>
strategy.setCustomTickPlacement((info) =>
new Array(10 + 1)
.fill(0)
.map((_, i) => ({ position: info.interval.start + (i / 10) * (info.interval.end - info.interval.start) })),
),
)
 chart.axisY.setTickStrategy(AxisTickStrategies.Numeric, (strategy) =>
strategy.setCustomTickPlacement({
major: (info) =>
new Array(10 + 1)
.fill(0)
.map((_, i) => ({ position: info.interval.start + (i / 10) * (info.interval.end - info.interval.start) })),
minor: (info) => {
const majorStep = (info.interval.end - info.interval.start) / 10
const minorStep = majorStep / 5
const minorTicks: CustomTickPlacementResult[] = []
let step = 0
while (true) {
const position = info.interval.start + step * minorStep
if (Math.sign(info.interval.end - position) !== Math.sign(info.interval.end - info.interval.start)) break
if (step % 5 === 0) {
// Dont add minor tick here, would overlap with major tick
} else {
minorTicks.push({ position })
}
step++
}
return minorTicks
},
}),
)
Introduced in v8.2.0. May be changed according to user feedback.
majorFormattingFunction?: FormattingFunction

Formatting function used for major ticks.

Use FormattingFunctions to select available ones or define custom function.

undefined will result in default selection.

majorTickStyle: TickStyle

Style of Major ticks.

minorFormattingFunction?: FormattingFunction

Formatting function used for minor ticks.

Use FormattingFunctions to select available ones or define custom function.

undefined will result in default selection.

minorTickStyle: TickStyle

Style of Minor ticks.

To disable minor ticks, set to emptyTick.

timeOrigin: undefined | number

optional "Time origin" value. If a timeOrigin is defined, data-points will instead be interpreted as milliseconds since timeOrigin.

type: "time-ticks"