]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * @class Ext.chart.series.CandleStick\r | |
3 | * @extends Ext.chart.series.Cartesian\r | |
4 | * \r | |
5 | * Creates a candlestick or OHLC Chart.\r | |
6 | *\r | |
7 | * @example\r | |
8 | * Ext.create({\r | |
9 | * xtype: 'cartesian', \r | |
10 | * renderTo: document.body,\r | |
11 | * width: 600,\r | |
12 | * height: 400,\r | |
13 | * insetPadding: 40,\r | |
14 | * store: {\r | |
15 | * fields: ['time', 'open', 'high', 'low', 'close'],\r | |
16 | * data: [{\r | |
17 | * 'time': new Date('Jan 1 2010').getTime(),\r | |
18 | * 'open': 600,\r | |
19 | * 'high': 614,\r | |
20 | * 'low': 578,\r | |
21 | * 'close': 590\r | |
22 | * }, {\r | |
23 | * 'time': new Date('Jan 2 2010').getTime(),\r | |
24 | * 'open': 590,\r | |
25 | * 'high': 609,\r | |
26 | * 'low': 580,\r | |
27 | * 'close': 580\r | |
28 | * }, {\r | |
29 | * 'time': new Date('Jan 3 2010').getTime(),\r | |
30 | * 'open': 580,\r | |
31 | * 'high': 602,\r | |
32 | * 'low': 578,\r | |
33 | * 'close': 602\r | |
34 | * }, {\r | |
35 | * 'time': new Date('Jan 4 2010').getTime(),\r | |
36 | * 'open': 602,\r | |
37 | * 'high': 614,\r | |
38 | * 'low': 586,\r | |
39 | * 'close': 586\r | |
40 | * }, {\r | |
41 | * 'time': new Date('Jan 5 2010').getTime(),\r | |
42 | * 'open': 586,\r | |
43 | * 'high': 602,\r | |
44 | * 'low': 565,\r | |
45 | * 'close': 565\r | |
46 | * }]\r | |
47 | * },\r | |
48 | * axes: [{\r | |
49 | * type: 'numeric',\r | |
50 | * position: 'left',\r | |
51 | * fields: ['open', 'high', 'low', 'close'],\r | |
52 | * title: {\r | |
53 | * text: 'Sample Values',\r | |
54 | * fontSize: 15\r | |
55 | * },\r | |
56 | * grid: true,\r | |
57 | * minimum: 560,\r | |
58 | * maximum: 640\r | |
59 | * }, {\r | |
60 | * type: 'time',\r | |
61 | * position: 'bottom',\r | |
62 | * fields: ['time'],\r | |
63 | * fromDate: new Date('Dec 31 2009'),\r | |
64 | * toDate: new Date('Jan 6 2010'),\r | |
65 | * title: {\r | |
66 | * text: 'Sample Values',\r | |
67 | * fontSize: 15\r | |
68 | * },\r | |
69 | * style: {\r | |
70 | * axisLine: false\r | |
71 | * }\r | |
72 | * }],\r | |
73 | * series: {\r | |
74 | * type: 'candlestick',\r | |
75 | * xField: 'time',\r | |
76 | * openField: 'open',\r | |
77 | * highField: 'high',\r | |
78 | * lowField: 'low',\r | |
79 | * closeField: 'close',\r | |
80 | * style: {\r | |
81 | * dropStyle: {\r | |
82 | * fill: 'rgb(222, 87, 87)',\r | |
83 | * stroke: 'rgb(222, 87, 87)',\r | |
84 | * lineWidth: 3\r | |
85 | * },\r | |
86 | * raiseStyle: {\r | |
87 | * fill: 'rgb(48, 189, 167)',\r | |
88 | * stroke: 'rgb(48, 189, 167)',\r | |
89 | * lineWidth: 3\r | |
90 | * }\r | |
91 | * }\r | |
92 | * }\r | |
93 | * });\r | |
94 | */\r | |
95 | Ext.define('Ext.chart.series.CandleStick', {\r | |
96 | extend: 'Ext.chart.series.Cartesian',\r | |
97 | requires: ['Ext.chart.series.sprite.CandleStick'],\r | |
98 | alias: 'series.candlestick',\r | |
99 | type: 'candlestick',\r | |
100 | seriesType: 'candlestickSeries',\r | |
101 | config: {\r | |
102 | /**\r | |
103 | * @cfg {String} openField\r | |
104 | * The store record field name that represents the opening value of the given period.\r | |
105 | */\r | |
106 | openField: null,\r | |
107 | /**\r | |
108 | * @cfg {String} highField\r | |
109 | * The store record field name that represents the highest value of the time interval represented.\r | |
110 | */\r | |
111 | highField: null,\r | |
112 | /**\r | |
113 | * @cfg {String} lowField\r | |
114 | * The store record field name that represents the lowest value of the time interval represented.\r | |
115 | */\r | |
116 | lowField: null,\r | |
117 | /**\r | |
118 | * @cfg {String} closeField\r | |
119 | * The store record field name that represents the closing value of the given period.\r | |
120 | */\r | |
121 | closeField: null\r | |
122 | },\r | |
123 | \r | |
124 | fieldCategoryY: ['Open', 'High', 'Low', 'Close'],\r | |
125 | \r | |
126 | themeColorCount: function() {\r | |
127 | return 2;\r | |
128 | }\r | |
129 | \r | |
130 | });\r |