chart.js: add ChartOptions.onHover alias and amend type (#24740)

Present in 2.7 as per docs and code
This commit is contained in:
Dylan Simon
2018-04-09 10:02:39 -07:00
committed by Mohamed Hegazy
parent 6a75839b6f
commit 00ca94db93
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -21,6 +21,9 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), {
hover: {
intersect: true
},
onHover(ev: MouseEvent, points: any[]) {
return;
},
tooltips: {
filter: data => Number(data.yLabel) > 0,
intersect: true,
+2 -1
View File
@@ -184,6 +184,7 @@ declare namespace Chart {
aspectRatio?: number;
maintainAspectRatio?: boolean;
events?: string[];
onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any;
onClick?(event?: MouseEvent, activeElements?: Array<{}>): any;
title?: ChartTitleOptions;
legend?: ChartLegendOptions;
@@ -291,7 +292,7 @@ declare namespace Chart {
mode?: string;
animationDuration?: number;
intersect?: boolean;
onHover?(active: any): void;
onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any;
}
interface ChartAnimationObject {