Creating the XML data document for the Chart | ||||||||||||||
Before building the chart, we need to have the data to be represented on the chart. We're plotting half yearly sales summary for a given year, say 2008. The following data in tabular form will be used for creating the XML data document for the chart. |
||||||||||||||
|
||||||||||||||
FusionCharts for Flex internally needs its data in pre-defined XML format. So, you need to convert this data into XML. | ||||||||||||||
Further, to know more about the XML structure used in FusionCharts for Flex, please go through 'FusionCharts and XML » Chart XML Reference' section. | ||||||||||||||
Here is the converted XML data: |
||||||||||||||
<chart caption='Half Yearly Sales Summary'
subcaption='For the year 2008 - First Half' xAxisName='Month' yAxisName='Sales' numberPrefix='$'> <set label='Jan' value='17400' /> <set label='Feb' value='19800' /> <set label='Mar' value='21800' /> <set label='Apr' value='23000' /> <set label='May' value='29000' /> <set label='June' value='27600' /> </chart> |
||||||||||||||
|
||||||||||||||
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"/> <ns1:FusionCharts x="10" y="10" FCDataURL="Data.xml" FCChartType="Column3D"/> </mx:Application> |
||||||||||||||
As you can see above, we have only set the chart type and provided appropriate chart data. That's it! Now, run the code and you'll get the following chart: |
||||||||||||||
![]() |