Flex實現雙軸組合圖

來源:互聯網
上載者:User

<?xml version="1.0" encoding="utf-8"?><s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"    xmlns:s="library://ns.adobe.com/flex/spark"    xmlns:mx="library://ns.adobe.com/flex/mx"    width="100%" height="100%"><s:layout><s:BasicLayout/></s:layout><fx:Declarations><s:SolidColor id="sc1" color="0x00BFFF" alpha=".3"/><mx:SolidColorStroke id="s1" color="0x00BFFF" weight="2"/></fx:Declarations><fx:Script><![CDATA[import mx.collections.ArrayCollection;//組合圖資料繫結[Bindable]private var gridArray:ArrayCollection = new ArrayCollection([{quarter:"第一季度",Monday:"78454",Tuesday:"45454",Wednesday:"12012",Thursday:"78441",Friday:"32314",Saturday:"89454",Sunday:"45421",Rate:"23"},{quarter:"第二季度",Monday:"56444",Tuesday:"65612",Wednesday:"78454",Thursday:"45124",Friday:"35451",Saturday:"45421",Sunday:"65421",Rate:"47"},{quarter:"第三季度",Monday:"51210",Tuesday:"94210",Wednesday:"65643",Thursday:"45011",Friday:"45122",Saturday:"45421",Sunday:"65988",Rate:"13"},{quarter:"第四季度",Monday:"61210",Tuesday:"45122",Wednesday:"65323",Thursday:"95110",Friday:"65623",Saturday:"45111",Sunday:"65311",Rate:"17"}]);]]></fx:Script><mx:VBox width="100%" height="100%"><mx:ColumnChart id="chart" width="100%" height="90%" showDataTips="true" fontSize="16" dataProvider="{gridArray}"><!--設定水平座標軸--><mx:horizontalAxis><mx:CategoryAxis dataProvider="{}" categoryField="quarter"/></mx:horizontalAxis><!--設定左豎直座標軸的最大值和最小值--><mx:verticalAxis><mx:LinearAxis minimum="0.00" maximum="100000.00"/></mx:verticalAxis><!--設定左豎直座標軸的直條圖--><mx:series><mx:ColumnSeries id="column1"  xField="quarter" yField="Monday" displayName="星期一"/><mx:ColumnSeries id="column2"  xField="quarter" yField="Tuesday" displayName="星期二"/><mx:ColumnSeries id="column3"  xField="quarter" yField="Wednesday" displayName="星期三"/><mx:ColumnSeries id="column4"  xField="quarter" yField="Thursday" displayName="星期四"/><mx:ColumnSeries id="column5"  xField="quarter" yField="Friday" displayName="星期六"/><mx:ColumnSeries id="column6"  xField="quarter" yField="Saturday" displayName="星期七"/><mx:ColumnSeries id="column7"  xField="quarter" yField="Sunday" displayName="星期八"/></mx:series><!--設定右豎直座標軸的最大值和最小值--><mx:secondVerticalAxis><mx:LinearAxis minimum="0.00" maximum="100.00"/></mx:secondVerticalAxis><!--設定右豎直座標軸的折線--><mx:secondSeries><mx:LineSeries id="line" dataProvider="{gridArray}" xField="quarter" yField="Rate" displayName="比率"/></mx:secondSeries></mx:ColumnChart><!--設定Legend屬性--><mx:HBox><s:Label width="25"/><mx:Legend dataProvider="{chart}" fontSize="20" width="100%" height="30" direction="horizontal" horizontalGap="45" verticalGap="45"/></mx:HBox></mx:VBox></s:Application>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.