]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * Stacked area are multi-series area charts where categories are stacked on top of each\r | |
3 | * other. This is typically done to emphasize the quantity while comparing multiple\r | |
4 | * categories.\r | |
5 | */\r | |
6 | Ext.define('KitchenSink.view.charts.area.Stacked', {\r | |
7 | extend: 'Ext.Panel',\r | |
8 | xtype: 'area-stacked',\r | |
9 | controller: 'area-stacked',\r | |
10 | \r | |
11 | // <example>\r | |
12 | // Content between example tags is omitted from code preview.\r | |
13 | bodyStyle: 'background: transparent !important',\r | |
14 | layout: {\r | |
15 | type: 'vbox',\r | |
16 | pack: 'center'\r | |
17 | },\r | |
18 | otherContent: [{\r | |
19 | type: 'Controller',\r | |
20 | path: 'classic/samples/view/charts/area/StackedController.js'\r | |
21 | }, {\r | |
22 | type: 'Store',\r | |
23 | path: 'classic/samples/store/Browsers.js'\r | |
24 | }],\r | |
25 | // </example>\r | |
26 | width: 650,\r | |
27 | \r | |
28 | tbar: [\r | |
29 | '->',\r | |
30 | {\r | |
31 | text: 'Preview',\r | |
32 | handler: 'onPreview'\r | |
33 | }\r | |
34 | ],\r | |
35 | \r | |
36 | items: [{\r | |
37 | xtype: 'cartesian',\r | |
38 | reference: 'chart',\r | |
39 | width: '100%',\r | |
40 | height: 500,\r | |
41 | insetPadding: 40,\r | |
42 | store: {\r | |
43 | type: 'browsers'\r | |
44 | },\r | |
45 | legend: {\r | |
46 | docked: 'bottom'\r | |
47 | },\r | |
48 | sprites: [{\r | |
49 | type: 'text',\r | |
50 | text: 'Area Charts - Stacked Area',\r | |
51 | fontSize: 22,\r | |
52 | width: 100,\r | |
53 | height: 30,\r | |
54 | x: 40, // the sprite x position\r | |
55 | y: 20 // the sprite y position\r | |
56 | }, {\r | |
57 | type: 'text',\r | |
58 | text: 'Data: Browser Stats 2012',\r | |
59 | fontSize: 10,\r | |
60 | x: 12,\r | |
61 | y: 420\r | |
62 | }, {\r | |
63 | type: 'text',\r | |
64 | text: 'Source: http://www.w3schools.com/',\r | |
65 | fontSize: 10,\r | |
66 | x: 12,\r | |
67 | y: 435\r | |
68 | }],\r | |
69 | axes: [{\r | |
70 | type: 'numeric',\r | |
71 | fields: 'data1',\r | |
72 | position: 'left',\r | |
73 | grid: true,\r | |
74 | minimum: 0,\r | |
75 | renderer: 'onAxisLabelRender'\r | |
76 | }, {\r | |
77 | type: 'category',\r | |
78 | fields: 'month',\r | |
79 | position: 'bottom',\r | |
80 | grid: true,\r | |
81 | label: {\r | |
82 | rotate: {\r | |
83 | degrees: -45\r | |
84 | }\r | |
85 | }\r | |
86 | }],\r | |
87 | series: [{\r | |
88 | type: 'area',\r | |
89 | title: [ 'IE', 'Firefox', 'Chrome', 'Safari' ],\r | |
90 | xField: 'month',\r | |
91 | yField: [ 'data1', 'data2', 'data3', 'data4' ],\r | |
92 | style: {\r | |
93 | opacity: 0.80\r | |
94 | },\r | |
95 | marker: {\r | |
96 | opacity: 0,\r | |
97 | scaling: 0.01,\r | |
98 | fx: {\r | |
99 | duration: 200,\r | |
100 | easing: 'easeOut'\r | |
101 | }\r | |
102 | },\r | |
103 | highlightCfg: {\r | |
104 | opacity: 1,\r | |
105 | scaling: 1.5\r | |
106 | },\r | |
107 | tooltip: {\r | |
108 | trackMouse: true,\r | |
109 | renderer: 'onSeriesTooltipRender'\r | |
110 | }\r | |
111 | }]\r | |
112 | //<example>\r | |
113 | }, {\r | |
114 | style: 'margin-top: 10px;',\r | |
115 | xtype: 'gridpanel',\r | |
116 | columns : {\r | |
117 | defaults: {\r | |
118 | sortable: false,\r | |
119 | menuDisabled: true,\r | |
120 | renderer: 'onColumnRender'\r | |
121 | },\r | |
122 | items: [\r | |
123 | { text: 'Month', dataIndex: 'month', renderer: Ext.identityFn },\r | |
124 | { text: 'IE', dataIndex: 'data1' },\r | |
125 | { text: 'Firefox', dataIndex: 'data2' },\r | |
126 | { text: 'Chrome', dataIndex: 'data3' },\r | |
127 | { text: 'Safari', dataIndex: 'data4' }\r | |
128 | ]\r | |
129 | },\r | |
130 | store: {\r | |
131 | type: 'browsers'\r | |
132 | },\r | |
133 | width: '100%'\r | |
134 | //</example>\r | |
135 | }]\r | |
136 | \r | |
137 | });\r |