diff --git a/src/controllers/controller.doughnut.js b/src/controllers/controller.doughnut.js index a6d4a63775a..fb4b37aad00 100644 --- a/src/controllers/controller.doughnut.js +++ b/src/controllers/controller.doughnut.js @@ -19,25 +19,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 19ceefddab7..06ed7483b03 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 d3fd5e35f04..d44c1f2163f 100644 --- a/src/plugins/plugin.legend.js +++ b/src/plugins/plugin.legend.js @@ -71,17 +71,21 @@ 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); });