From: Evert Timberg Date: Sun, 5 Jul 2015 18:56:22 +0000 (-0400) Subject: Doughnut legends (only makes sense for first dataset). X-Git-Tag: 2.0.0-alpha4~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=925e3051846572d553c3eed89e95a5db8f3c9fae;p=thirdparty%2FChart.js.git Doughnut legends (only makes sense for first dataset). --- diff --git a/samples/doughnut.html b/samples/doughnut.html index f2c4282f8..ae6bbc9e5 100644 --- a/samples/doughnut.html +++ b/samples/doughnut.html @@ -26,6 +26,12 @@ +
+

Legend

+
+ +
+
diff --git a/src/charts/Chart.Doughnut.js b/src/charts/Chart.Doughnut.js index d01959d44..ccea714f3 100644 --- a/src/charts/Chart.Doughnut.js +++ b/src/charts/Chart.Doughnut.js @@ -5,7 +5,12 @@ var Chart = root.Chart; var helpers = Chart.helpers; + var defaultConfig = { + legendTemplate: "", + }; + Chart.Doughnut = function(context, config) { + config.options = helpers.configMerge(defaultConfig, config.options); config.type = 'doughnut'; return new Chart(context, config);