Skip to content

Commit

Permalink
fix(types): fix data.onshown/hidden types
Browse files Browse the repository at this point in the history
- Fix wrong types for data.onshown/onhidden function params
- Add missing newly added(#2270) tooltip.position params types

Fix #2275
  • Loading branch information
netil committed Aug 23, 2021
1 parent 8d8e92d commit 3721c4c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions types/options.d.ts
Expand Up @@ -983,7 +983,12 @@ export interface TooltipOptions {
data: any,
width: number,
height: number,
element: any
element: any,
pos: {
x: number;
y: number;
xAxis?: number;
}
) => { top: number; left: number });

/**
Expand Down Expand Up @@ -1670,13 +1675,13 @@ export interface Data {
* Set a callback for when data is shown.
* The callback will receive shown data ids in array.
*/
onshown?(): void;
onshown?(this: Chart, ids: string[]): void;

/**
* Set a callback for when data is hidden.
* The callback will receive hidden data ids in array.
*/
onhidden?(): void;
onhidden?(this: Chart, ids: string[]): void;
}

export type FormatFunction = (
Expand Down

0 comments on commit 3721c4c

Please sign in to comment.