From: Tanner Linsley Date: Tue, 16 Jun 2015 04:47:20 +0000 (-0600) Subject: Pie used new doughnut controller X-Git-Tag: 2.0.0-alpha3~10^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5759f419c06b0882bfe28579c73aa745de43014b;p=thirdparty%2FChart.js.git Pie used new doughnut controller --- diff --git a/samples/pie.html b/samples/pie.html index 34b126ec0..6f97bd43e 100644 --- a/samples/pie.html +++ b/samples/pie.html @@ -21,6 +21,7 @@ }; var config = { + type: 'pie', data: { datasets: [{ data: [ @@ -83,7 +84,7 @@ window.onload = function() { var ctx = document.getElementById("chart-area").getContext("2d"); - window.myPie = new Chart(ctx).Pie(config); + window.myPie = new Chart(ctx, config); }; $('#randomizeData').click(function() { diff --git a/src/controllers/controller.doughnut.js b/src/controllers/controller.doughnut.js index 110b2b5c7..63aad3173 100644 --- a/src/controllers/controller.doughnut.js +++ b/src/controllers/controller.doughnut.js @@ -18,11 +18,15 @@ }, //The percentage of the chart that we cut out of the middle. cutoutPercentage: 50, - }; + Chart.defaults.pie = helpers.clone(Chart.defaults.doughnut); + helpers.extend(Chart.defaults.pie, { + cutoutPercentage: 0 + }); + - Chart.controllers.doughnut = function(chart, datasetIndex) { + Chart.controllers.doughnut = Chart.controllers.pie = function(chart, datasetIndex) { this.initialize.call(this, chart, datasetIndex); };