From 76d38d894f396cf0084f70d88c6ff1bc3ad79eaf Mon Sep 17 00:00:00 2001 From: Glen Date: Sun, 2 Dec 2018 14:05:33 +0200 Subject: [PATCH] hoverBackgroundColor and hoverBorderColor should accept Color/Color[] --- types/chart.js/chart.js-tests.ts | 6 +++++- types/chart.js/index.d.ts | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 705392baed..fd5ed53e80 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -9,7 +9,9 @@ const plugin = { } }; -const chart: Chart = new Chart(new CanvasRenderingContext2D(), { +const ctx = new CanvasRenderingContext2D(); + +const chart: Chart = new Chart(ctx, { type: "bar", plugins: [plugin, plugin], data: { @@ -17,6 +19,8 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { datasets: [ { backgroundColor: "#000000", + hoverBackgroundColor: ctx.createLinearGradient(0, 0, 0, 100), + hoverBorderColor: ctx.createLinearGradient(0, 0, 0, 100), borderWidth: 1, label: "test", data: [1, null, 3] diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 884ddaa760..2803def896 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -554,8 +554,8 @@ declare namespace Chart { borderSkipped?: PositionType; data?: Array | ChartPoint[]; fill?: boolean | number | string; - hoverBackgroundColor?: string | string[]; - hoverBorderColor?: string | string[]; + hoverBackgroundColor?: ChartColor | ChartColor[]; + hoverBorderColor?: ChartColor | ChartColor[]; hoverBorderWidth?: number | number[]; label?: string; lineTension?: number;