当前位置: 代码迷 >> Web前端 >> ColumnChart附加树状图
  详细解决方案

ColumnChart附加树状图

热度:336   发布时间:2012-10-06 17:34:01.0
ColumnChart叠加树状图

主要就是type这个这个值!!!

废话不多说,上图看代码!

type="stacked"

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top"
    horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" paddingTop="0" viewSourceURL="srcview/index.html">
    
    <mx:Script>
        <![CDATA[
          
        import mx.collections.ArrayCollection;

        [Bindable]
        private var medalsAC:ArrayCollection = new ArrayCollection( [
            { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
            { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
            { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 } ]);
        ]]>
    </mx:Script>
    
    <mx:Panel title="ColumnChart Control" layout="horizontal" color="0xffffff" borderAlpha="0.15" width="600" height="240"
         paddingTop="10" paddingRight="5" paddingBottom="10" paddingLeft="5" horizontalAlign="center">
         
         <mx:ColumnChart type="stacked" id="column" height="100%" color="0x323232"
            showDataTips="true" dataProvider="{medalsAC}" >
                
            <mx:horizontalAxis>
                <mx:CategoryAxis categoryField="Country"/>
            </mx:horizontalAxis>
                
            <mx:series>
                <mx:ColumnSeries xField="Country" yField="Gold" displayName="Gold"/>
                <mx:ColumnSeries xField="Country" yField="Silver" displayName="Silver"/>
                <mx:ColumnSeries xField="Country" yField="Bronze" displayName="Bronze"/>
            </mx:series>
        </mx:ColumnChart>

        <mx:Legend dataProvider="{column}" color="0x323232"/>
        
    </mx:Panel>
</mx:Application>

?

效果图:


?

type="100%"



?

type="clustered"



?type="overlaid"



?
?

?

  相关解决方案