]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * Stacked 3D columns are column charts where categories are stacked on top of each other.\r | |
3 | * This is typically done to visually represent the total of all categories\r | |
4 | * for a given period or value.\r | |
5 | */\r | |
6 | Ext.define('KitchenSink.view.charts.column3d.Stacked', {\r | |
7 | extend: 'Ext.panel.Panel',\r | |
8 | xtype: 'column-stacked-3d',\r | |
9 | controller: 'column-stacked-3d',\r | |
10 | //<example>\r | |
11 | otherContent: [{\r | |
12 | type: 'Controller',\r | |
13 | path: 'classic/samples/view/charts/column3d/StackedController.js'\r | |
14 | }, {\r | |
15 | type: 'Store',\r | |
16 | path: 'classic/samples/store/EconomySectors.js'\r | |
17 | }],\r | |
18 | //</example>\r | |
19 | \r | |
20 | requires: [\r | |
21 | 'Ext.chart.CartesianChart',\r | |
22 | 'Ext.chart.axis.Numeric',\r | |
23 | 'Ext.chart.axis.Time',\r | |
24 | 'Ext.draw.modifier.Highlight',\r | |
25 | 'Ext.chart.interactions.ItemHighlight',\r | |
26 | 'Ext.chart.theme.*'\r | |
27 | ],\r | |
28 | \r | |
29 | layout: 'vbox',\r | |
30 | width: 650,\r | |
31 | \r | |
32 | tbar: [\r | |
33 | '->',\r | |
34 | {\r | |
35 | text: 'Switch Theme',\r | |
36 | handler: 'onThemeSwitch'\r | |
37 | },\r | |
38 | {\r | |
39 | xtype: 'segmentedbutton',\r | |
40 | width: 200,\r | |
41 | items: [{\r | |
42 | text: 'Stack',\r | |
43 | pressed: true\r | |
44 | }, {\r | |
45 | text: 'Group'\r | |
46 | }],\r | |
47 | listeners: {\r | |
48 | toggle: 'onStackedToggle'\r | |
49 | }\r | |
50 | }\r | |
51 | ],\r | |
52 | \r | |
53 | items: [{\r | |
54 | xtype: 'cartesian',\r | |
55 | reference: 'chart',\r | |
56 | store: {type: 'economy-sectors'},\r | |
57 | theme: 'Muted',\r | |
58 | insetPadding: '40 20 10 20',\r | |
59 | width: '100%',\r | |
60 | height: 500,\r | |
61 | interactions: ['itemhighlight'],\r | |
62 | series: {\r | |
63 | type: 'bar3d',\r | |
64 | xField: 'country',\r | |
65 | yField: ['agr', 'ind', 'ser'],\r | |
66 | title: ['Agriculture', 'Industry', 'Services'],\r | |
67 | style: {\r | |
68 | maxBarWidth: 80\r | |
69 | },\r | |
70 | highlight: true,\r | |
71 | tooltip: {\r | |
72 | trackMouse: true,\r | |
73 | renderer: 'onTooltipRender'\r | |
74 | }\r | |
75 | },\r | |
76 | legend: {\r | |
77 | docked: 'bottom'\r | |
78 | },\r | |
79 | axes: [{\r | |
80 | type: 'numeric3d',\r | |
81 | position: 'left',\r | |
82 | grid: {\r | |
83 | odd: {\r | |
84 | fillStyle: 'rgba(255, 255, 255, 0.06)'\r | |
85 | },\r | |
86 | even: {\r | |
87 | fillStyle: 'rgba(0, 0, 0, 0.03)'\r | |
88 | }\r | |
89 | },\r | |
90 | title: 'Billions of USD',\r | |
91 | renderer: 'onAxisLabelRender',\r | |
92 | listeners: {\r | |
93 | rangechange: 'onAxisRangeChange'\r | |
94 | }\r | |
95 | }, {\r | |
96 | type: 'category3d',\r | |
97 | position: 'bottom',\r | |
98 | grid: true\r | |
99 | }],\r | |
100 | sprites: {\r | |
101 | type: 'text',\r | |
102 | text: 'Major economies by GDP sector composition (2011)',\r | |
103 | fontSize: 22,\r | |
104 | width: 100,\r | |
105 | height: 30,\r | |
106 | x: 40,\r | |
107 | y: 20\r | |
108 | }\r | |
109 | }, {\r | |
110 | xtype: 'container',\r | |
111 | width: '100%',\r | |
112 | padding: 10,\r | |
113 | layout: {\r | |
114 | type: 'hbox',\r | |
115 | pack: 'center'\r | |
116 | },\r | |
117 | items: {\r | |
118 | xtype: 'form',\r | |
119 | defaults: {\r | |
120 | labelAlign: 'right',\r | |
121 | labelPad: 15,\r | |
122 | width: 400\r | |
123 | },\r | |
124 | items: [{\r | |
125 | xtype: 'sliderfield',\r | |
126 | fieldLabel: 'Saturation',\r | |
127 | value: 1,\r | |
128 | maxValue: 1.5,\r | |
129 | increment: 0.05,\r | |
130 | decimalPrecision: 2,\r | |
131 | listeners: {\r | |
132 | change: 'onSaturationChange',\r | |
133 | dragstart: 'onSliderDragStart',\r | |
134 | dragend: 'onSliderDragEnd'\r | |
135 | }\r | |
136 | }, {\r | |
137 | xtype: 'sliderfield',\r | |
138 | fieldLabel: 'Brightness',\r | |
139 | value: 1,\r | |
140 | maxValue: 1.5,\r | |
141 | increment: 0.05,\r | |
142 | decimalPrecision: 2,\r | |
143 | listeners: {\r | |
144 | change: 'onBrightnessChange',\r | |
145 | dragstart: 'onSliderDragStart',\r | |
146 | dragend: 'onSliderDragEnd'\r | |
147 | }\r | |
148 | }, {\r | |
149 | xtype: 'sliderfield',\r | |
150 | fieldLabel: 'Color Spread',\r | |
151 | value: 1,\r | |
152 | maxValue: 1.5,\r | |
153 | increment: 0.05,\r | |
154 | decimalPrecision: 2,\r | |
155 | listeners: {\r | |
156 | change: 'onColorSpreadChange',\r | |
157 | dragstart: 'onSliderDragStart',\r | |
158 | dragend: 'onSliderDragEnd'\r | |
159 | }\r | |
160 | }]\r | |
161 | }\r | |
162 | }]\r | |
163 | \r | |
164 | });\r |