]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * Marked lines are multi-series lines displaying trends across multiple categories.\r | |
3 | * Markers are placed at each point to clearly depict their position on the chart.\r | |
4 | */\r | |
5 | Ext.define('KitchenSink.view.charts.line.Marked', {\r | |
6 | extend: 'Ext.panel.Panel',\r | |
7 | xtype: 'line-marked',\r | |
8 | controller: 'line-marked',\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/line/MarkedController.js'\r | |
20 | }, {\r | |
21 | type: 'Store',\r | |
22 | path: 'classic/samples/store/Browsers.js'\r | |
23 | }],\r | |
24 | // </example>\r | |
25 | width: 650,\r | |
26 | \r | |
27 | tbar: [\r | |
28 | '->',\r | |
29 | {\r | |
30 | text: 'Toggle markers',\r | |
31 | handler: 'onToggleMarkers'\r | |
32 | },\r | |
33 | {\r | |
34 | text: 'Preview',\r | |
35 | handler: 'onPreview'\r | |
36 | }\r | |
37 | ],\r | |
38 | \r | |
39 | items: [{\r | |
40 | xtype: 'cartesian',\r | |
41 | reference: 'chart',\r | |
42 | width: '100%',\r | |
43 | height: 500,\r | |
44 | legend: {\r | |
45 | docked: 'right'\r | |
46 | },\r | |
47 | store: {\r | |
48 | type: 'browsers'\r | |
49 | },\r | |
50 | insetPadding: 40,\r | |
51 | sprites: [{\r | |
52 | type: 'text',\r | |
53 | text: 'Line Charts - Marked Lines',\r | |
54 | fontSize: 22,\r | |
55 | width: 100,\r | |
56 | height: 30,\r | |
57 | x: 40, // the sprite x position\r | |
58 | y: 20 // the sprite y position\r | |
59 | }, {\r | |
60 | type: 'text',\r | |
61 | text: 'Data: Browser Stats 2012',\r | |
62 | fontSize: 10,\r | |
63 | x: 12,\r | |
64 | y: 470\r | |
65 | }, {\r | |
66 | type: 'text',\r | |
67 | text: 'Source: http://www.w3schools.com/',\r | |
68 | fontSize: 10,\r | |
69 | x: 12,\r | |
70 | y: 485\r | |
71 | }],\r | |
72 | axes: [{\r | |
73 | type: 'numeric',\r | |
74 | fields: ['data1', 'data2', 'data3', 'data4' ],\r | |
75 | position: 'left',\r | |
76 | grid: true,\r | |
77 | minimum: 0,\r | |
78 | renderer: 'onAxisLabelRender'\r | |
79 | }, {\r | |
80 | type: 'category',\r | |
81 | fields: 'month',\r | |
82 | position: 'bottom',\r | |
83 | grid: true,\r | |
84 | label: {\r | |
85 | rotate: {\r | |
86 | degrees: -45\r | |
87 | }\r | |
88 | }\r | |
89 | }],\r | |
90 | series: [{\r | |
91 | type: 'line',\r | |
92 | title: 'IE',\r | |
93 | xField: 'month',\r | |
94 | yField: 'data1',\r | |
95 | marker: {\r | |
96 | type: 'square',\r | |
97 | fx: {\r | |
98 | duration: 200,\r | |
99 | easing: 'backOut'\r | |
100 | }\r | |
101 | },\r | |
102 | highlightCfg: {\r | |
103 | scaling: 2\r | |
104 | },\r | |
105 | tooltip: {\r | |
106 | trackMouse: true,\r | |
107 | renderer: 'onSeriesTooltipRender'\r | |
108 | }\r | |
109 | }, {\r | |
110 | type: 'line',\r | |
111 | title: 'Firefox',\r | |
112 | xField: 'month',\r | |
113 | yField: 'data2',\r | |
114 | marker: {\r | |
115 | type: 'triangle',\r | |
116 | fx: {\r | |
117 | duration: 200,\r | |
118 | easing: 'backOut'\r | |
119 | }\r | |
120 | },\r | |
121 | highlightCfg: {\r | |
122 | scaling: 2\r | |
123 | },\r | |
124 | tooltip: {\r | |
125 | trackMouse: true,\r | |
126 | renderer: 'onSeriesTooltipRender'\r | |
127 | }\r | |
128 | }, {\r | |
129 | type: 'line',\r | |
130 | title: 'Chrome',\r | |
131 | xField: 'month',\r | |
132 | yField: 'data3',\r | |
133 | marker: {\r | |
134 | type: 'arrow',\r | |
135 | fx: {\r | |
136 | duration: 200,\r | |
137 | easing: 'backOut'\r | |
138 | }\r | |
139 | },\r | |
140 | highlightCfg: {\r | |
141 | scaling: 2\r | |
142 | },\r | |
143 | tooltip: {\r | |
144 | trackMouse: true,\r | |
145 | renderer: 'onSeriesTooltipRender'\r | |
146 | }\r | |
147 | }, {\r | |
148 | type: 'line',\r | |
149 | title: 'Safari',\r | |
150 | xField: 'month',\r | |
151 | yField: 'data4',\r | |
152 | marker: {\r | |
153 | type: 'cross',\r | |
154 | fx: {\r | |
155 | duration: 200,\r | |
156 | easing: 'backOut'\r | |
157 | }\r | |
158 | },\r | |
159 | highlightCfg: {\r | |
160 | scaling: 2\r | |
161 | },\r | |
162 | tooltip: {\r | |
163 | trackMouse: true,\r | |
164 | renderer: 'onSeriesTooltipRender'\r | |
165 | }\r | |
166 | }]\r | |
167 | //<example>\r | |
168 | }, {\r | |
169 | style: 'margin-top: 10px;',\r | |
170 | xtype: 'gridpanel',\r | |
171 | columns : {\r | |
172 | defaults: {\r | |
173 | sortable: false,\r | |
174 | menuDisabled: true,\r | |
175 | renderer: 'onColumnRender'\r | |
176 | },\r | |
177 | items: [\r | |
178 | { text: 'Month', dataIndex: 'month', renderer: Ext.identityFn },\r | |
179 | { text: 'IE', dataIndex: 'data1' },\r | |
180 | { text: 'Firefox', dataIndex: 'data2' },\r | |
181 | { text: 'Chrome', dataIndex: 'data3' },\r | |
182 | { text: 'Safari', dataIndex: 'data4' }\r | |
183 | ]\r | |
184 | },\r | |
185 | store: {type: 'browsers'},\r | |
186 | width: '100%'\r | |
187 | //</example>\r | |
188 | }]\r | |
189 | });\r |