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 Numeric cursor formatting.
// Example value, custom cursor formatter
cursorFormatter: (value, range, locale) => value.toFixed(3)
Readonly 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 extremeFormatting function used for extreme ticks.
Use FormattingFunctions to select available ones or define custom function.
undefined will result in default selection.
Readonly extremeStyle of Extreme ticks (start & end of Axis).
To disable extreme ticks, set to emptyTick.
Readonly fallIf true (default) if at any time the axis would display only 1 or 0 tick labels, then automatically fallback to "extreme ticks" behavior
(display axis start + end).
Aim is to avoid very unfortunate cases where only 1 tick label fits into the chart. This kind of axis is practically unreadable, as the value range can not be perceived.
Readonly formattingOptional coordinate to offset from tick coordinates when formatting tick labels and default cursor labels.
If supplied, the value of formattingOffset will be added to every coordinate before formatting.
This can be useful for offsetting displayed data ranges in cases where actual data can't be practically rendered due to extremely large numbers for example.
// Example, specify formatting offset.
Axis.setTickStrategy(AxisTickStrategies.Numeric, (ticks) => ticks
// Will result in `0` being formatted as `1000000`
.setFormattingOffset(1000000)
)
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.
Modifiable properties of a Numeric TickStrategy.