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

index 2d8972e6e2fa4bae1c31931cf1857988d90dd101..d17c7be0029d568f3265f8c574be38749d37ee7c 100644 (file)
@@ -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;
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: [],