Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / examples / chart / pie-chart.js
diff --git a/examples/chart/pie-chart.js b/examples/chart/pie-chart.js
new file mode 100644 (file)
index 0000000..4340f93
--- /dev/null
@@ -0,0 +1,53 @@
+/*!
+ * Ext JS Library 3.0.0
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+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
+});
\ No newline at end of file