Merge pull request #30984 from glen-84/chartjs-hover-colors

[chart.js] hoverBackgroundColor and hoverBorderColor should accept Color/Color[]
This commit is contained in:
Andrew Casey
2018-12-07 11:24:31 -08:00
committed by GitHub
2 changed files with 7 additions and 3 deletions
+5 -1
View File
@@ -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]
+2 -2
View File
@@ -554,8 +554,8 @@ declare namespace Chart {
borderSkipped?: PositionType;
data?: Array<number | null | undefined> | ChartPoint[];
fill?: boolean | number | string;
hoverBackgroundColor?: string | string[];
hoverBorderColor?: string | string[];
hoverBackgroundColor?: ChartColor | ChartColor[];
hoverBorderColor?: ChartColor | ChartColor[];
hoverBorderWidth?: number | number[];
label?: string;
lineTension?: number;