]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Pie used new doughnut controller
authorTanner Linsley <tannerlinsley@gmail.com>
Tue, 16 Jun 2015 04:47:20 +0000 (22:47 -0600)
committerTanner Linsley <tannerlinsley@gmail.com>
Tue, 16 Jun 2015 04:47:20 +0000 (22:47 -0600)
samples/pie.html
src/controllers/controller.doughnut.js

index 34b126ec0625354fb1f698c63cb4ee0742eb9801..6f97bd43eec453e7d376c7933ab2de7b4d4ea574 100644 (file)
@@ -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(ctxconfig);
     };
 
     $('#randomizeData').click(function() {
index 110b2b5c721a4d21614cfd48528c42b6d8b94bda..63aad31735f6aabb49cfd842d3e5e5b1b8dcbc21 100644 (file)
                },
                //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);
        };