Monday, 28 March 2011

Form Designing In Flex III (Column Chart)


<?xml version="1.0" encoding="utf-8"?>

<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"
 layout="absolute"
 width="100%" height="100%">

<mx:VBox>
<mx:FormHeading label="Column Chart"/>

<mx:ColumnChart id="cAgeChart" dataProvider="{this._chartDataProvider}" showDataTips="true" width="500" height="590">

<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{this._chartDataProvider}" categoryField="chartAgeRange"/>
</mx:horizontalAxis>

<mx:series>
<mx:ColumnSeries xField="chartAgeRange" yField="noOfUser" displayName="No. of Users">
<mx:fill>
<mx:SolidColor color="haloGreen" alpha=".8"/>
</mx:fill>
</mx:ColumnSeries>
</mx:series>

</mx:ColumnChart>

<mx:Legend dataProvider="{cAgeChart}"/>
</mx:VBox>

<mx:Script>
<![CDATA[

import mx.collections.ArrayCollection;

[Bindable] public var _chartDataProvider:ArrayCollection;

public function set chartDataProvider(chartsDataProviderArg:ArrayCollection):void
{
this._chartDataProvider = chartsDataProviderArg;
}

[Bindable]
public function get chartDataProvider():ArrayCollection
{
return this._chartDataProvider;
}
]]>
</mx:Script>

</mx:Panel>

No comments:

Post a Comment