Simple PieChart using mx:PieChart

This application helps to create a simple Pie Chart using mx:PieChart.

<?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">
	
	<fx:Script>
	<![CDATA[
			import mx.collections.ArrayCollection;
			[Bindable]
			public var expenses:ArrayCollection = new ArrayCollection([
			{Expense:"India", Amount:2000},
			{Expense:"UK", Amount:1000},
			{Expense:"USA", Amount:100},
			{Expense:"Australia", Amount:450},
			{Expense:"SriLanka", Amount:100},
			{Expense:"France", Amount:200}
			]);
		]]>
	</fx:Script>
		<mx:PieChart id="myChart" 
					 dataProvider="{expenses}" 
					 showDataTips="true"
					 width="100%" height="90%"
					 >
			<mx:series>
				<mx:PieSeries 
					field="Amount" 
					nameField="Expense" 
					labelPosition="callout"
					/>
			</mx:series>
		</mx:PieChart>
		<mx:Legend dataProvider="{myChart}" direction="horizontal"/>
</s:Application>

Advertisements

About Ajeeth Boaz

I am a freelance photographer you can find my clicks @ www.ajeethboaz.com. I am a Developer by profession, I like sharing my experience through blogs you can find it @ http://blog.ajeethboaz.com/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: