diff --git a/src/controllers/controller.doughnut.js b/src/controllers/controller.doughnut.js index de418e7edbc..7cee5444457 100644 --- a/src/controllers/controller.doughnut.js +++ b/src/controllers/controller.doughnut.js @@ -22,25 +22,25 @@ defaults._set('doughnut', { mode: 'single' }, legendCallback: function(chart) { - var text = []; - text.push(''); - return text.join(''); + return list.outerHTML; }, legend: { labels: { diff --git a/src/controllers/controller.polarArea.js b/src/controllers/controller.polarArea.js index 1e0e30ba2dd..76ca3b70cae 100644 --- a/src/controllers/controller.polarArea.js +++ b/src/controllers/controller.polarArea.js @@ -32,25 +32,25 @@ defaults._set('polarArea', { startAngle: -0.5 * Math.PI, legendCallback: function(chart) { - var text = []; - text.push(''); - return text.join(''); + return list.outerHTML; }, legend: { labels: { diff --git a/src/plugins/plugin.legend.js b/src/plugins/plugin.legend.js index 91ff07a20bd..dc5b9325d6f 100644 --- a/src/plugins/plugin.legend.js +++ b/src/plugins/plugin.legend.js @@ -78,17 +78,22 @@ defaults._set('global', { }, legendCallback: function(chart) { - var text = []; - text.push(''); - return text.join(''); + + return list.outerHTML; } }); diff --git a/test/specs/global.defaults.tests.js b/test/specs/global.defaults.tests.js index a01284c1a0b..afef1aabf2a 100644 --- a/test/specs/global.defaults.tests.js +++ b/test/specs/global.defaults.tests.js @@ -102,7 +102,7 @@ describe('Default Configs', function() { options: config }); - var expectedLegend = ''; + var expectedLegend = ''; expect(chart.generateLegend()).toBe(expectedLegend); }); @@ -218,7 +218,7 @@ describe('Default Configs', function() { options: config }); - var expectedLegend = ''; + var expectedLegend = ''; expect(chart.generateLegend()).toBe(expectedLegend); });