diff --git a/src/charts/Chart.Doughnut.js b/src/charts/Chart.Doughnut.js
index 05a9764bd..74c917323 100644
--- a/src/charts/Chart.Doughnut.js
+++ b/src/charts/Chart.Doughnut.js
@@ -7,7 +7,23 @@
var defaultConfig = {
aspectRatio: 1,
- legendTemplate: "
-legend\"><% for (var i = 0; i < data.datasets[0].data.length; i++){%>- \"><%if(data.labels && i < data.labels.length){%><%=data.labels[i]%><%}%>
<%}%>
",
+ legendCallback: function(chart) {
+ var text = [];
+ text.push('');
+
+ if (chart.data.datasets.length) {
+ for (var i = 0; i < chart.data.datasets[0].data.length; ++i) {
+ text.push('- ');
+ if (chart.data.labels[i]) {
+ text.push(chart.data.labels[i]);
+ }
+ text.push('
');
+ }
+ }
+
+ text.push('
');
+ return text.join("");
+ }
};
Chart.Doughnut = function(context, config) {
diff --git a/src/charts/Chart.PolarArea.js b/src/charts/Chart.PolarArea.js
index 20171f7f7..2b44bb9aa 100644
--- a/src/charts/Chart.PolarArea.js
+++ b/src/charts/Chart.PolarArea.js
@@ -7,7 +7,23 @@
var defaultConfig = {
aspectRatio: 1,
- legendTemplate: "-legend\"><% for (var i = 0; i < data.datasets[0].data.length; i++){%>- \"><%if(data.labels && i < data.labels.length){%><%=data.labels[i]%><%}%>
<%}%>
",
+ legendCallback: function(chart) {
+ var text = [];
+ text.push('');
+
+ if (chart.data.datasets.length) {
+ for (var i = 0; i < chart.data.datasets[0].data.length; ++i) {
+ text.push('- ');
+ if (chart.data.labels[i]) {
+ text.push(chart.data.labels[i]);
+ }
+ text.push('
');
+ }
+ }
+
+ text.push('
');
+ return text.join("");
+ }
};
Chart.PolarArea = function(context, config) {