* @param ticks the list of ticks being converted
* @return string representation of the tickValue parameter
*/
- numeric(tickValue: number, index: number, ticks: { value: number }[]): string;
+ numeric(this: Scale, tickValue: number, index: number, ticks: { value: number }[]): string;
/**
* Formatter for logarithmic ticks
* @param tickValue the value to be formatted
* @param ticks the list of ticks being converted
* @return string representation of the tickValue parameter
*/
- logarithmic(tickValue: number, index: number, ticks: { value: number }[]): string;
+ logarithmic(this: Scale, tickValue: number, index: number, ticks: { value: number }[]): string;
};
};
--- /dev/null
+import { Chart, Ticks } from '../../../src/types.js';
+
+// @ts-expect-error The 'this' context... is not assignable to method's 'this' of type 'Scale<CoreScaleOptions>'.
+Ticks.formatters.numeric(0, 0, [{ value: 0 }]);
+
+const chart = new Chart('test', {
+ type: 'line',
+ data: {
+ datasets: [{
+ data: [{ x: 1, y: 1 }]
+ }]
+ },
+});
+
+Ticks.formatters.numeric.call(chart.scales.x, 0, 0, [{ value: 0 }]);