]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Don't make legend empty when fill is false (#6718)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Mon, 11 Nov 2019 01:03:38 +0000 (17:03 -0800)
committerEvert Timberg <evert.timberg+github@gmail.com>
Mon, 11 Nov 2019 01:03:38 +0000 (20:03 -0500)
src/core/core.datasetController.js
test/specs/plugin.legend.tests.js

index 9d33d72a9b44dacea452bb052848e4cbc365f12b..43afbc113788f71a1e80b527fc032026fbb0e800 100644 (file)
@@ -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;
index 1fd4821bb59a0a3d30b3757aa335bb77f40e0c10..880a72c6532d799c02447c49c14171612167d3be 100644 (file)
@@ -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: [],