]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Create doughnut.color.html
authorChristopher Weiss <cmweiss@gmail.com>
Tue, 21 Oct 2014 14:16:30 +0000 (10:16 -0400)
committerChristopher Weiss <cmweiss@gmail.com>
Tue, 21 Oct 2014 14:16:30 +0000 (10:16 -0400)
To test the new version of doughnut.

samples/doughnut.color.html [new file with mode: 0644]

diff --git a/samples/doughnut.color.html b/samples/doughnut.color.html
new file mode 100644 (file)
index 0000000..00b5503
--- /dev/null
@@ -0,0 +1,57 @@
+<!doctype html>
+<html>
+       <head>
+               <title>Doughnut Chart</title>
+               <script src="../Chart.js"></script>
+               <style>
+                       body{
+                               padding: 0;
+                               margin: 0;
+                       }
+                       #canvas-holder{
+                               width:30%;
+                       }
+               </style>
+       </head>
+       <body>
+               <div id="canvas-holder">
+                       <canvas id="chart-area" width="500" height="500"/>
+               </div>
+
+
+       <script>
+
+               var doughnutData = [
+                               {
+                                       value: 1,
+                                       label: "One"
+                               },
+                               {
+                                       value: 2,
+                                       label: "Two"
+                               },
+                               {
+                                       value: 3,
+                                       label: "Three"
+                               },
+                               {
+                                       value: 4,
+                                       label: "Four"
+                               },
+                               {
+                                       value: 5,
+                                       label: "Five"
+                               }
+
+                       ];
+
+                       window.onload = function(){
+                               var ctx = document.getElementById("chart-area").getContext("2d");
+                               window.myDoughnut = new Chart(ctx).Doughnut(doughnutData, {responsive : true});
+                       };
+
+
+
+       </script>
+       </body>
+</html>