Country.XML
<main> <item Country= “USA” Gold=”35″ Silver=”39″ Bronze=”29″/> <item Country= “China” Gold=”32″ Silver=”17″ Bronze=”14″/> <item Country= “Russia” Gold=”27″ Silver=”27″ Bronze=”38″/> </main> |
Step2: Load Country.xml and convert it to XMLList
ColumnSeries: Defines a data series for a ColumnChart control.
CategoryAxis: CategoryAxis class to define a set of labels that appear along an axis of a chart.
setStyle: Sets a style property on any component instance. Here setStyle has been used to define the colors for each series
Color Codes which are applied for the Charts below
ChartDataXML.mxml
<?xml version=”1.0″ encoding=”utf-8″?><mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute” creationComplete=”createComplete(event)”><mx:Script><![CDATA[ import mx.charts.CategoryAxis;
private function LoadCountry(e:Event):void var CL:XML=new XML(e.target.data) //Setting Horizontal Axis var NS:ColumnSeries= new ColumnSeries(); IColumn1.series.push(NS) //Pushing columnseries to the column chart (just like a values been pushed to
IColumn1.series.push(NS) //Pushing columnseries to the column chart (just like a values been pushed to //Column Serier for Gold var NS:ColumnSeries = new ColumnSeries(); |
You typically use the CategoryAxis class to define a set of labels that
appear along an axis of a chart
Output