快捷搜索:

Flash 报表之 BarChart & BubbleChart

1.BarChart 显示数据为一系列的水平条,起长度代表着响应的数值。

以上是BarChart 的效果图,显示了不合门生数学和中文的成就

2.BarChart 应用代码

1 mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

2mx:Script>

3[CDATA[

4import mx.collections.ArrayCollection;

5

6public var scores:ArrayCollection=new ArrayCollection([

7{id:1,name:"贺臣",Maths:98,Chinese:82},

8{id:2,name:"菜包",Maths:66,Chinese:77},

9{id:3,name:"张三",Maths:23,Chinese:99},

10{id:4,name:"王五",Maths:88,Chinese:55}

11]);

12

13]]>

14mx:Script>

15mx:Panel x="98" y="40" width="485" height="392" layout="absolute">

16mx:BarChart x="16" y="10" id="myBarChart" height="256" width="433" showDataTips="true" dataProvider="{scores}">

17mx:verticalAxis>

18mx:CategoryAxis dataProvider="{scores}" categoryField="name"/>

19mx:verticalAxis>

20mx:series>

21mx:BarSeries xField="Maths" yField="name" displayName="Maths"/>

22mx:BarSeries xField="Chinese" yField="name" displayName="Chinese"/>

23mx:series>

24mx:BarChart>

25mx:Legend dataProvider="{myBarChart}" x="16" y="289" width="433"/>

26

27mx:Panel>

28 mx:Application>

您可能还会对下面的文章感兴趣: