Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / docs / source / pie-chart.html
diff --git a/docs/source/pie-chart.html b/docs/source/pie-chart.html
new file mode 100644 (file)
index 0000000..72db934
--- /dev/null
@@ -0,0 +1,56 @@
+<html>\r
+<head>\r
+  <title>The source code</title>\r
+    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
+    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
+</head>\r
+<body  onload="prettyPrint();">\r
+    <pre class="prettyprint lang-js">Ext.chart.Chart.CHART_URL = '../../resources/charts.swf';\r
+\r
+Ext.onReady(function(){\r
+    var store = new Ext.data.JsonStore({\r
+        fields: ['season', 'total'],\r
+        data: [{\r
+            season: 'Summer',\r
+            total: 150\r
+        },{\r
+            season: 'Fall',\r
+            total: 245\r
+        },{\r
+            season: 'Winter',\r
+            total: 117\r
+        },{\r
+            season: 'Spring',\r
+            total: 184\r
+        }]\r
+    });\r
+    \r
+    new Ext.Panel({\r
+        width: 400,\r
+        height: 400,\r
+        title: 'Pie Chart with Legend - Favorite Season',\r
+        renderTo: 'container',\r
+        items: {\r
+            store: store,\r
+            xtype: 'piechart',\r
+            dataField: 'total',\r
+            categoryField: 'season',\r
+            //extra styles get applied to the chart defaults\r
+            extraStyle:\r
+            {\r
+                legend:\r
+                {\r
+                    display: 'bottom',\r
+                    padding: 5,\r
+                    font:\r
+                    {\r
+                        family: 'Tahoma',\r
+                        size: 13\r
+                    }\r
+                }\r
+            }\r
+        }\r
+    });\r
+});</pre>    \r
+</body>\r
+</html>
\ No newline at end of file