<?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="LineChart 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:LineChart id="linechart" color="0x323232" height="100%"
showDataTips="true" dataProvider="{expensesAC}">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="Month"/>
</mx:horizontalAxis>
<mx:series>
<mx:LineSeries yField="Profit" form="curve" displayName="Profit"/>
<mx:LineSeries yField="Expenses" form="curve" displayName="Expenses"/>
<mx:LineSeries yField="Amount" form="curve" displayName="Amount"/>
</mx:series>
</mx:LineChart>
<mx:Legend dataProvider="{linechart}" color="0x323232"/>
</mx:Panel>
</mx:Application>
No comments:
Post a Comment