mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-08 17:19:27 +08:00
[highcharts] Added type for axis labels formatter execution context (#22244)
This commit is contained in:
committed by
Mohamed Hegazy
parent
c5fe3ac33e
commit
9a3fbe89bd
8
types/highcharts/index.d.ts
vendored
8
types/highcharts/index.d.ts
vendored
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user