Readonly cursorReadonly Beta customAllows specifying custom logic, overriding where axis ticks are placed.
This logic can either be specified:
// 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.
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.
Cursor formatter.
This controls the formatting used by:
TickStrategy.Axis.formatValuemethod of the Axis which uses thisTickStrategy.undefinedmeans to use default Time cursor formatting.