From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Mon, 11 Nov 2019 01:03:30 +0000 (-0800) Subject: Don't make legend empty when fill is false (#6719) X-Git-Tag: v2.9.3~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a307a2a63d60440f9c6c6ce37319a16ba1e1e53d;p=thirdparty%2FChart.js.git Don't make legend empty when fill is false (#6719) --- diff --git a/src/core/core.datasetController.js b/src/core/core.datasetController.js index 2d8972e6e..d17c7be00 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 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: [],