]> git.proxmox.com Git - extjs.git/blame - extjs/examples/kitchensink/modern/src/view/chart/Area.js
add extjs 6.0.1 sources
[extjs.git] / extjs / examples / kitchensink / modern / src / view / chart / Area.js
CommitLineData
6527f429
DM
1/**\r
2 * Demonstrates how to use Ext.chart.AreaChart\r
3 */\r
4Ext.define('KitchenSink.view.chart.Area', {\r
5 extend: 'Ext.Panel',\r
6 requires: [\r
7 'Ext.chart.CartesianChart',\r
8 'Ext.chart.interactions.PanZoom',\r
9 'Ext.chart.series.Area',\r
10 'Ext.chart.axis.Numeric',\r
11 'KitchenSink.view.chart.ChartController'\r
12 ],\r
13\r
14 controller: {\r
15 type: 'chart',\r
16 defaultVisibleRange: {\r
17 bottom: [0, 0.25]\r
18 }\r
19 },\r
20\r
21 layout: 'fit',\r
22 items: [{\r
23 xtype: 'toolbar',\r
24 docked: 'top',\r
25 cls: 'charttoolbar',\r
26 items: [{\r
27 xtype: 'spacer'\r
28 }, {\r
29 iconCls: 'x-fa fa-picture-o',\r
30 text: 'Theme',\r
31 handler: 'onThemeChange'\r
32 }, {\r
33 iconCls: 'x-fa fa-refresh',\r
34 text: 'Refresh',\r
35 handler: function() {\r
36 Ext.getStore('OrderItems').generateData(25);\r
37 }\r
38 }, {\r
39 text: 'Reset',\r
40 handler: 'onReset'\r
41 }]\r
42 }, {\r
43 xtype: 'cartesian',\r
44 store: 'OrderItems',\r
45 legend: {\r
46 position: 'bottom'\r
47 },\r
48 insetPadding: {\r
49 left: 10,\r
50 bottom: 0,\r
51 top: 15,\r
52 right: 35\r
53 },\r
54 interactions: [{\r
55 type: 'panzoom',\r
56 axes: {\r
57 left: {\r
58 allowPan: false,\r
59 allowZoom: false\r
60 },\r
61 bottom: {\r
62 allowPan: true,\r
63 allowZoom: true\r
64 }\r
65 }\r
66 }],\r
67 series: [{\r
68 type: 'area',\r
69 xField: 'name',\r
70 yField: ['g1', 'g2', 'g3', 'g4', 'g5'],\r
71 title: ['G1', 'G2', 'G3', 'G4', 'G5'],\r
72 style: {\r
73 stroke: 'black',\r
74 lineWidth: 2,\r
75 fillOpacity: 0.8\r
76 }\r
77 }],\r
78 axes: [{\r
79 type: 'numeric',\r
80 position: 'left',\r
81 fields: ['g1', 'g2', 'g3', 'g4', 'g5', 'g6'],\r
82 label: {\r
83 rotate: {\r
84 degrees: -30\r
85 }\r
86 },\r
87 grid: {\r
88 odd: {\r
89 fill: '#e8e8e8'\r
90 }\r
91 },\r
92 title: {\r
93 text: 'Summation of Data',\r
94 fontSize: 20\r
95 }\r
96 }, {\r
97 type: 'category',\r
98 position: 'bottom',\r
99 fields: 'name',\r
100 grid: true,\r
101 visibleRange: [0, 0.25],\r
102 title: {\r
103 text: 'Item Names',\r
104 fontSize: 20\r
105 }\r
106 }]\r
107 }],\r
108\r
109 initialize: function() {\r
110 this.callParent();\r
111 Ext.getStore('OrderItems').generateData(25);\r
112 }\r
113});