1.CandlestickChart 显示金融数据为一系列的蜡烛图,其体现高低开关的相关数值。每个图像的垂直线上的上顶点和下地点代表了每个数据点的高低数值,填充盒子的上顶和下底分别代表开发和关闭的数值。

 Flash 报表之 CandlestickChart & ColumnChart

 

2. CandlestickChart 的使用代码

 1 <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
 2     <mx:Script>
 3         <![CDATA[
 4             import mx.collections.ArrayCollection;
 5             
 6             public var scores:ArrayCollection=new ArrayCollection([
 7                 {date:"2001",open:43,close:45,hight:67,low:12},
 8                 {date:"2002",open:34,close:43,hight:88,low:23},
 9                 {date:"2003",open:87,close:12,hight:99,low:10},
10                 {date:"2004",open:33,close:55,hight:66,low:8}
11             ]);
12             
13         ]]>
14     </mx:Script>
15     <mx:Panel x="98" y="40" width="485" height="392" layout="absolute">
16         <mx:CandlestickChart x="10" y="10" id="myCandleChart" height="271" width="445" dataProvider="{scores}" showDataTips="true">
17             <mx:horizontalAxis>
18                 <mx:CategoryAxis dataProvider="{scores}" categoryField="date"/>
19             </mx:horizontalAxis>
20             <mx:series>
21                 <mx:CandlestickSeries displayName="haha" openField="open" closeField="close" highField="hight" lowField="low"/>
22             </mx:series>
23         </mx:CandlestickChart>
24         <mx:Legend dataProvider="{myCandleChart}" x="10" y="289" width="445"/>
25         
26     </mx:Panel>
27 </mx:Application>

相关文章: