]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * 100% stacked area are multi-series area charts where categories are stacked (percentage\r | |
3 | * values) on top of each other, with an additional category 'Others' that is used to sum\r | |
4 | * up the various categories for each series to a perfect 100%.\r | |
5 | */\r | |
6 | Ext.define('KitchenSink.view.charts.area.Stacked100', {\r | |
7 | extend: 'Ext.Panel',\r | |
8 | xtype: 'area-stacked-100',\r | |
9 | controller: 'area-stacked-100',\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/Stacked100Controller.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 - 100% 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 | position: 'left',\r | |
72 | fields: ['data1', 'data2', 'data3', 'data4', 'other' ],\r | |
73 | grid: true,\r | |
74 | minimum: 0,\r | |
75 | maximum: 100,\r | |
76 | renderer: 'onAxisLabelRender'\r | |
77 | }, {\r | |
78 | type: 'category',\r | |
79 | position: 'bottom',\r | |
80 | fields: 'month',\r | |
81 | grid: true,\r | |
82 | label: {\r | |
83 | rotate: {\r | |
84 | degrees: -45\r | |
85 | }\r | |
86 | }\r | |
87 | }],\r | |
88 | series: [{\r | |
89 | type: 'area',\r | |
90 | fullStack: true,\r | |
91 | title: [ 'IE', 'Firefox', 'Chrome', 'Safari', 'Others' ],\r | |
92 | xField: 'month',\r | |
93 | yField: [ 'data1', 'data2', 'data3', 'data4', 'other' ],\r | |
94 | style: {\r | |
95 | opacity: 0.80\r | |
96 | },\r | |
97 | marker: {\r | |
98 | opacity: 0,\r | |
99 | scaling: 0.01,\r | |
100 | fx: {\r | |
101 | duration: 200,\r | |
102 | easing: 'easeOut'\r | |
103 | }\r | |
104 | },\r | |
105 | highlightCfg: {\r | |
106 | opacity: 1,\r | |
107 | scaling: 1.5\r | |
108 | },\r | |
109 | tooltip: {\r | |
110 | trackMouse: true,\r | |
111 | renderer: 'onSeriesTooltipRender'\r | |
112 | }\r | |
113 | }]\r | |
114 | //<example>\r | |
115 | }, {\r | |
116 | style: 'margin-top: 10px;',\r | |
117 | xtype: 'gridpanel',\r | |
118 | columns : {\r | |
119 | defaults: {\r | |
120 | sortable: false,\r | |
121 | menuDisabled: true,\r | |
122 | renderer: 'onColumnRender'\r | |
123 | },\r | |
124 | items: [\r | |
125 | { text: 'Month', dataIndex: 'month', renderer: Ext.identityFn },\r | |
126 | { text: 'IE', dataIndex: 'data1' },\r | |
127 | { text: 'Firefox', dataIndex: 'data2' },\r | |
128 | { text: 'Chrome', dataIndex: 'data3' },\r | |
129 | { text: 'Safari', dataIndex: 'data4' },\r | |
130 | { text: 'Other', dataIndex: 'other' }\r | |
131 | ]\r | |
132 | },\r | |
133 | store: {\r | |
134 | type: 'browsers'\r | |
135 | },\r | |
136 | width: '100%'\r | |
137 | //</example>\r | |
138 | }]\r | |
139 | \r | |
140 | });\r |