From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Mon, 11 Nov 2019 01:03:38 +0000 (-0800) Subject: Don't make legend empty when fill is false (#6718) X-Git-Tag: v3.0.0-alpha~250 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49c4761e1bb9a1628b1eb43abe12a7b4570dd40c;p=thirdparty%2FChart.js.git Don't make legend empty when fill is false (#6718) --- diff --git a/src/core/core.datasetController.js b/src/core/core.datasetController.js index 9d33d72a9..43afbc113 100644 --- a/src/core/core.datasetController.js +++ b/src/core/core.datasetController.js @@ -762,7 +762,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 1fd4821bb..880a72c65 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: [],