diff -r 322d0feea350 -r 89ef5ed3c48b src/cm/media/js/lib/yui/yui_3.10.3/docs/charts/charts-pie.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cm/media/js/lib/yui/yui_3.10.3/docs/charts/charts-pie.html Tue Jul 16 14:29:46 2013 +0200 @@ -0,0 +1,276 @@ + + + + + Example: Pie Chart + + + + + + + + + + +
+
+

+
+ + +

Example: Pie Chart

+
+
+
+
+
+

This example shows how to use Charts to create a Pie Chart.

+
+
+
+ + +
+

Creating a Pie Chart.

+ + +

The Chart class also allows you to create a Pie Chart. All you need to do is set the type attribute to "pie", define your categoryKey, +seriesKey and seriesCollection.

+ +

CSS

+
#mychart {
+    margin:10px 10px 10px 10px;
+    width:400px;
+    height:400px;
+}
+ + +

HTML

+
<div id="mychart"></div>
+ + +

JavaScript

+
YUI().use('charts', function (Y) 
+{ 
+    // Create data 
+    var myDataValues = [
+            {day:"Monday", taxes:2000}, 
+            {day:"Tuesday", taxes:50}, 
+            {day:"Wednesday", taxes:4000}, 
+            {day:"Thursday", taxes:200}, 
+            {day:"Friday", taxes:2000}
+    ];				
+
+    var pieGraph = new Y.Chart({
+            render:"#mychart", 
+            categoryKey:"day", 
+            seriesKeys:["taxes"], 
+            dataProvider:myDataValues, 
+            type:"pie", 
+            seriesCollection:[
+                {
+                    categoryKey:"day",
+                    valueKey:"taxes"
+                }
+            ]
+        });
+});
+ +
+
+
+ +
+ +
+
+
+ + + + + + + + + + +