]> git.proxmox.com Git - extjs.git/blame - extjs/build/examples/kitchensink/modern/src/view/chart/Scatter.js
add extjs 6.0.1 sources
[extjs.git] / extjs / build / examples / kitchensink / modern / src / view / chart / Scatter.js
CommitLineData
6527f429
DM
1/**\r
2 * Demonstrates how to use Ext.chart.ScatterChart\r
3 */\r
4Ext.define('KitchenSink.view.chart.Scatter', {\r
5 extend: 'Ext.Panel',\r
6 requires: [\r
7 'Ext.chart.CartesianChart',\r
8 'Ext.chart.series.Scatter',\r
9 'Ext.chart.axis.Numeric'\r
10 ],\r
11\r
12 controller: {\r
13 type: 'chart',\r
14 defaultVisibleRange: {\r
15 left: [0, 1],\r
16 bottom: [0, 0.5]\r
17 }\r
18 },\r
19\r
20 layout: 'fit',\r
21 items: [{\r
22 xtype: 'toolbar',\r
23 docked: 'top',\r
24 cls: 'charttoolbar',\r
25 items: [{\r
26 xtype: 'spacer'\r
27 }, {\r
28 iconCls: 'x-fa fa-picture-o',\r
29 text: 'Theme',\r
30 handler: 'onThemeChange'\r
31 }, {\r
32 iconCls: 'x-fa fa-refresh',\r
33 text: 'Refresh',\r
34 handler: function() {\r
35 Ext.getStore('OrderItems').generateData(25);\r
36 }\r
37 }, {\r
38 text: 'Reset',\r
39 handler: 'onReset'\r
40 }]\r
41 }, {\r
42 xtype: 'cartesian',\r
43 store: 'OrderItems',\r
44 legend: {\r
45 position: 'bottom'\r
46 },\r
47 background: 'white',\r
48 interactions: [\r
49 'panzoom',\r
50 'itemhighlight'\r
51 ],\r
52 series: [{\r
53 type: 'scatter',\r
54 xField: 'id',\r
55 yField: 'g1',\r
56 highlightCfg: {\r
57 strokeStyle: 'red',\r
58 lineWidth: 5\r
59 },\r
60 marker: {\r
61 type: 'path',\r
62 path: [\r
63 ['M', 0, 1],\r
64 ['L', 1, 0],\r
65 ['L', 0, -1],\r
66 ['L', -1, 0],\r
67 ['Z']\r
68 ],\r
69 scale: 10,\r
70 lineWidth: 2\r
71 }\r
72 }, {\r
73 type: 'scatter',\r
74 xField: 'id',\r
75 yField: 'g2',\r
76 highlightCfg: {\r
77 strokeStyle: 'red',\r
78 lineWidth: 5\r
79 },\r
80 marker: {\r
81 type: 'circle',\r
82 radius: 10,\r
83 lineWidth: 2\r
84 }\r
85 }],\r
86 axes: [{\r
87 type: 'numeric',\r
88 position: 'left',\r
89 fields: ['g1', 'g2', 'g3', 'g4'],\r
90 visibleRange: [0, 1],\r
91 style: {\r
92 estStepSize: 20\r
93 },\r
94 label: {\r
95 rotate: {\r
96 degrees: -30\r
97 }\r
98 }\r
99 }, {\r
100 type: 'category',\r
101 position: 'bottom',\r
102 visibleRange: [0, 0.5],\r
103 fields: 'id'\r
104 }]\r
105 }],\r
106\r
107 initialize: function() {\r
108 this.callParent();\r
109 Ext.getStore('OrderItems').generateData(25);\r
110 var toolbar = Ext.ComponentQuery.query('toolbar', this)[0],\r
111 interaction = Ext.ComponentQuery.query('interaction', this)[0];\r
112 if (toolbar && interaction && !interaction.isMultiTouch()) {\r
113 toolbar.add(interaction.getModeToggleButton());\r
114 }\r
115 }\r
116});