[highcharts] Added type for axis labels formatter execution context (#22244)

This commit is contained in:
Nikita Grafov
2018-01-03 22:29:25 +03:00
committed by Mohamed Hegazy
parent c5fe3ac33e
commit 9a3fbe89bd
2 changed files with 8 additions and 2 deletions

View File

@@ -55,6 +55,12 @@ declare namespace Highcharts {
max: number;
}
interface AxisLabelFormatterOptions {
value: number;
isFirst: number;
isLast: number;
}
interface AxisLabels {
/**
* What part of the string the given position is anchored to. Can be one of 'left', 'center' or 'right'. Defaults to
@@ -100,7 +106,7 @@ declare namespace Highcharts {
* this are axis, chart, isFirst and isLast.
* @default function() {return this.value;}
*/
formatter?(): string;
formatter?(this: AxisLabelFormatterOptions): string;
/**
* Horizontal axis only. When staggerLines is not set, maxStaggerLines defines how many lines the axis is allowed to
* add to automatically avoid overlapping X labels. Set to 1 to disable overlap detection.

View File

@@ -2247,7 +2247,7 @@ function test_AxisOptions() {
distance: 10,
enabled: true,
format: "format",
formatter() { return this.value; },
formatter() { return String(this.value); },
maxStaggerLines: 5,
overflow: false,
padding: 10,