From a307a2a63d60440f9c6c6ce37319a16ba1e1e53d Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sun, 10 Nov 2019 17:03:30 -0800 Subject: [PATCH] Don't make legend empty when fill is false (#6719) --- src/core/core.datasetController.js | 2 +- test/specs/plugin.legend.tests.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/core.datasetController.js b/src/core/core.datasetController.js index 2d8972e6e2f..d17c7be0029 100644 --- a/src/core/core.datasetController.js +++ b/src/core/core.datasetController.js @@ -347,7 +347,7 @@ helpers.extend(DatasetController.prototype, { } if (style.fill === false || style.fill === null) { - style.backgroundColor = 'rgba(0,0,0,0)'; + style.backgroundColor = style.borderColor; } return style; diff --git a/test/specs/plugin.legend.tests.js b/test/specs/plugin.legend.tests.js index 1fd4821bb59..880a72c6532 100644 --- a/test/specs/plugin.legend.tests.js +++ b/test/specs/plugin.legend.tests.js @@ -149,7 +149,7 @@ describe('Legend block tests', function() { datasetIndex: 1 }, { text: 'dataset3', - fillStyle: 'rgba(0,0,0,0)', + fillStyle: 'green', hidden: false, lineCap: 'butt', lineDash: [], @@ -198,7 +198,7 @@ describe('Legend block tests', function() { expect(chart.legend.legendItems).toEqual([{ text: 'dataset3', - fillStyle: 'rgba(0,0,0,0)', + fillStyle: 'green', hidden: false, lineCap: 'butt', lineDash: [],