<?xml version="1.0"
encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" verticalAlign="top"
horizontalAlign="center"
backgroundGradientColors="[#570A0A, #731F1F]" paddingTop="0"
backgroundGradientAlphas="[1.0, 1.0]">
<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 } ]);
]]>
</mx:Script>
<mx:Panel title="AreaChart Control" layout="horizontal" color="0xffffff" borderAlpha="0.15" width="600" height="240"
paddingTop="10" paddingRight="5" paddingBottom="10" paddingLeft="5" horizontalAlign="center" x="10" y="10">
<mx:AreaChart id="Areachart" color="0x323232" height="100%"
showDataTips="true" dataProvider="{expensesAC}">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="Month"/>
</mx:horizontalAxis>
<mx:series>
<mx:AreaSeries yField="Profit" form="curve" displayName="Profit"/>
<mx:AreaSeries yField="Expenses" form="curve" displayName="Expenses"/>
<mx:AreaSeries yField="Amount" form="curve" displayName="Amount"/>
</mx:series>
</mx:AreaChart>
<mx:Legend dataProvider="{Areachart}" color="0x323232"/>
</mx:Panel>
</mx:Application>
No comments:
Post a Comment