]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * A basic line chart displays information as a series of data points connected through\r | |
3 | * straight lines. It is similar to scatter plot, except that the points are connected.\r | |
4 | * Line charts are often used to visualize trends in data over a period.\r | |
5 | */\r | |
6 | Ext.define('KitchenSink.view.charts.line.Basic', {\r | |
7 | extend: 'Ext.Panel',\r | |
8 | xtype: 'line-basic',\r | |
9 | controller: 'line-basic',\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/line/BasicController.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 | items: {\r | |
29 | xtype: 'cartesian',\r | |
30 | reference: 'chart',\r | |
31 | width: '100%',\r | |
32 | height: 500,\r | |
33 | interactions: {\r | |
34 | type: 'panzoom',\r | |
35 | zoomOnPanGesture: true\r | |
36 | },\r | |
37 | animation: {\r | |
38 | duration: 200\r | |
39 | },\r | |
40 | store: {\r | |
41 | type: 'browsers'\r | |
42 | },\r | |
43 | insetPadding: 40,\r | |
44 | innerPadding: {\r | |
45 | left: 40,\r | |
46 | right: 40\r | |
47 | },\r | |
48 | sprites: [{\r | |
49 | type: 'text',\r | |
50 | text: 'Line Charts - Basic Line',\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: 470\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: 485\r | |
68 | }],\r | |
69 | axes: [{\r | |
70 | type: 'numeric',\r | |
71 | position: 'left',\r | |
72 | grid: true,\r | |
73 | minimum: 0,\r | |
74 | maximum: 24,\r | |
75 | renderer: 'onAxisLabelRender'\r | |
76 | }, {\r | |
77 | type: 'category',\r | |
78 | position: 'bottom',\r | |
79 | grid: true,\r | |
80 | label: {\r | |
81 | rotate: {\r | |
82 | degrees: -45\r | |
83 | }\r | |
84 | }\r | |
85 | }],\r | |
86 | series: [{\r | |
87 | type: 'line',\r | |
88 | xField: 'month',\r | |
89 | yField: 'data1',\r | |
90 | style: {\r | |
91 | lineWidth: 2\r | |
92 | },\r | |
93 | marker: {\r | |
94 | radius: 4,\r | |
95 | lineWidth: 2\r | |
96 | },\r | |
97 | label: {\r | |
98 | field: 'data1',\r | |
99 | display: 'over'\r | |
100 | },\r | |
101 | highlight: {\r | |
102 | fillStyle: '#000',\r | |
103 | radius: 5,\r | |
104 | lineWidth: 2,\r | |
105 | strokeStyle: '#fff'\r | |
106 | },\r | |
107 | tooltip: {\r | |
108 | trackMouse: true,\r | |
109 | showDelay: 0,\r | |
110 | dismissDelay: 0,\r | |
111 | hideDelay: 0,\r | |
112 | renderer: 'onSeriesTooltipRender'\r | |
113 | }\r | |
114 | }],\r | |
115 | listeners: {\r | |
116 | itemhighlightchange: 'onItemHighlightChange'\r | |
117 | }\r | |
118 | },\r | |
119 | \r | |
120 | tbar: ['->', {\r | |
121 | text: 'Preview',\r | |
122 | handler: 'onPreview'\r | |
123 | }]\r | |
124 | \r | |
125 | });\r |