]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * A basic area chart is similar to the line chart, except the area between axis and line\r | |
3 | * is filled with colors to emphasize quantity.\r | |
4 | */\r | |
5 | Ext.define('KitchenSink.view.charts.area.Basic', {\r | |
6 | extend: 'Ext.Panel',\r | |
7 | xtype: 'area-basic',\r | |
8 | controller: 'area-basic',\r | |
9 | \r | |
10 | // <example>\r | |
11 | // Content between example tags is omitted from code preview.\r | |
12 | bodyStyle: 'background: transparent !important',\r | |
13 | layout: {\r | |
14 | type: 'vbox',\r | |
15 | pack: 'center'\r | |
16 | },\r | |
17 | otherContent: [{\r | |
18 | type: 'Controller',\r | |
19 | path: 'classic/samples/view/charts/area/BasicController.js'\r | |
20 | }, {\r | |
21 | type: 'Store',\r | |
22 | path: 'classic/samples/store/GDP.js'\r | |
23 | }],\r | |
24 | // </example>\r | |
25 | width: 650,\r | |
26 | \r | |
27 | tbar: [\r | |
28 | '->',\r | |
29 | {\r | |
30 | text: 'Preview',\r | |
31 | handler: 'onPreview'\r | |
32 | }\r | |
33 | ],\r | |
34 | \r | |
35 | items: [{\r | |
36 | xtype: 'cartesian',\r | |
37 | reference: 'chart',\r | |
38 | width: '100%',\r | |
39 | height: 600,\r | |
40 | insetPadding: '40 40 40 40',\r | |
41 | store: {\r | |
42 | type: 'gdp'\r | |
43 | },\r | |
44 | legend: {\r | |
45 | docked: 'bottom'\r | |
46 | },\r | |
47 | sprites: [{\r | |
48 | type: 'text',\r | |
49 | text: 'Economic Development in the USA, Japan and China',\r | |
50 | fontSize: 22,\r | |
51 | width: 100,\r | |
52 | height: 30,\r | |
53 | x: 40, // the sprite x position\r | |
54 | y: 20 // the sprite y position\r | |
55 | }, {\r | |
56 | type: 'text',\r | |
57 | text: 'Data: Gross domestic product based on purchasing-power-parity (PPP) valuation of country GDP. Figures for FY2014 are forecasts.',\r | |
58 | fontSize: 10,\r | |
59 | x: 12,\r | |
60 | y: 525\r | |
61 | }, {\r | |
62 | type: 'text',\r | |
63 | text: 'Source: http://www.imf.org/ World Economic Outlook Database October 2014.',\r | |
64 | fontSize: 10,\r | |
65 | x: 12,\r | |
66 | y: 540\r | |
67 | }],\r | |
68 | axes: [{\r | |
69 | type: 'numeric',\r | |
70 | position: 'left',\r | |
71 | fields: ['china', 'japan', 'usa'],\r | |
72 | title: 'GDP in billions of US Dollars',\r | |
73 | grid: true,\r | |
74 | minimum: 0,\r | |
75 | maximum: 20000,\r | |
76 | majorTickSteps: 10,\r | |
77 | renderer: 'onAxisLabelRender'\r | |
78 | }, {\r | |
79 | type: 'category',\r | |
80 | position: 'bottom',\r | |
81 | fields: 'year',\r | |
82 | label: {\r | |
83 | rotate: {\r | |
84 | degrees: -45\r | |
85 | }\r | |
86 | }\r | |
87 | }]\r | |
88 | // No 'series' config here,\r | |
89 | // as series are dynamically added in the controller.\r | |
90 | //<example>\r | |
91 | }, {\r | |
92 | style: 'margin-top: 10px;',\r | |
93 | xtype: 'gridpanel',\r | |
94 | columns : {\r | |
95 | defaults: {\r | |
96 | sortable: false,\r | |
97 | menuDisabled: true\r | |
98 | },\r | |
99 | items: [\r | |
100 | { text: 'Year', dataIndex: 'year' },\r | |
101 | { text: 'China', dataIndex: 'china'},\r | |
102 | { text: 'Japan', dataIndex: 'japan'},\r | |
103 | { text: 'USA', dataIndex: 'usa'}\r | |
104 | ]\r | |
105 | },\r | |
106 | store: {type: 'gdp'},\r | |
107 | width: '100%'\r | |
108 | //</example>\r | |
109 | }],\r | |
110 | \r | |
111 | listeners: {\r | |
112 | afterrender: 'onAfterRender'\r | |
113 | }\r | |
114 | \r | |
115 | });\r |