From a434bcf6ed61673b7284a01e30e9cfb7048bd23f Mon Sep 17 00:00:00 2001 From: tonybadguy Date: Mon, 30 Mar 2020 17:16:40 -0700 Subject: [PATCH] [@types/chart.js] Added missing axis field to hover options (#43253) * update test * added missing axis field * pr update --- types/chart.js/chart.js-tests.ts | 3 +++ types/chart.js/index.d.ts | 2 ++ 2 files changed, 5 insertions(+) diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 4f1b48017d..7382cebdf2 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -37,6 +37,9 @@ const chart: Chart = new Chart(ctx, { }, options: { hover: { + axis: 'xy', + mode: 'nearest', + animationDuration: 400, intersect: true, }, onHover(ev: MouseEvent, points: any[]) { diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 7f67fefaa9..dbdb2ad1ea 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -25,6 +25,7 @@ // Carlos Anoceto // Nobuhiko Futagami // Marco Ru +// Tony Liu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -442,6 +443,7 @@ declare namespace Chart { mode?: InteractionMode; animationDuration?: number; intersect?: boolean; + axis?: 'x' | 'y' | 'xy'; onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any; }