zjkilly 发表于 2013-2-7 15:08:18

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="" paddingTop="0" viewSourceURL="srcview/index.html">      <mx:Script>      <!      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> 
效果图:

http://dl.iteye.com/upload/attachment/424122/45403364-bc0d-3ceb-bb02-2c2dbb15c14c.jpg
 
type="100%"

http://dl.iteye.com/upload/attachment/424139/fff6fd5b-4b4b-37c6-a5d7-81f74acaa0f3.jpg
 
type="clustered"

http://dl.iteye.com/upload/attachment/424141/cd74fda3-e25b-3163-a090-c25aa23af961.jpg
 type="overlaid"

http://dl.iteye.com/upload/attachment/424143/b0c871ee-2f10-3a05-a036-2e25af6927c0.jpg
 
 
 
页: [1]
查看完整版本: ColumnChart叠加树状图