`
baobeituping
  • 浏览: 1074128 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
社区版块
存档分类
最新评论

Flex图表篇(mx:BubberChart)

阅读更多

<?xml version="1.0"?>
<!-- Simple example to demonstrate the ColumnChart and BarChart controls. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <mx:Script>
        <![CDATA[
         
      
       import mx.collections.ArrayCollection;

        [Bindable]
  private var expensesAC:ArrayCollection = new ArrayCollection( [
            { Month: "Jan", Profit: 2000, Expenses: 1500, Amount: 450 },
            { Month: "Feb", Profit: 1000, Expenses: 200, Amount: 600 },
            { Month: "Mar", Profit: 1500, Expenses: 500, Amount: 300 },
            { Month: "Apr", Profit: 1800, Expenses: 1200, Amount: 900 },
            { Month: "May", Profit: 2400, Expenses: 575, Amount: 500 } ]);
         //定义数据源:Month表示数据个数,名字可以随便定义
        ]]>
    </mx:Script>
  <mx:Style>       
        BubbleChart { color:#000099; }、、定义气泡的样式
    </mx:Style>
    <mx:Panel title="ColumnChart and BarChart Controls Example"
        height="100%" width="100%" layout="horizontal">
        <mx:BubbleChart id="JBubber" showDataTips="true" dataProvider="{expensesAC}" width="635">

//showDataTips表示是否显示每一个气泡的详细信息
            <mx:series>
                <mx:BubbleSeries displayName="Profix/Expenses/Amount" yField="Expenses" radiusField="Amount" xField="Profit"/>

//displayName表示显示详细信息的标题,xField表示显示的第一行数据,yField表示显示的第2行数据,radiusField表示气泡的大小
            </mx:series>
        </mx:BubbleChart>
        <mx:Legend dataProvider="{JBubber}"/>

     
    </mx:Panel>
</mx:Application>

分享到:
评论
Global site tag (gtag.js) - Google Analytics