FusionCharts for Flex > Chart Creation > Multi-Series > Data from URL

In the previous examples, we were using single series XML Data, as we were plotting data for just 1 year. Let's now consider a case where we want to compare our half yearly sales data for 2006 against sales data for 2007. We will be using the same data in the coming sections as well.

 
Before you continue, we recommend that you go through the "Your First Chart" section, as we start off from the concepts explained in that section.
 
Creating the XML data document for the Chart
Here, we will build a Multi-series Column 3D chart. The following data (see table below) will be used for creating the XML data document for the chart.
 
Month
2006
2007
January
$17400
$18300
February
$19800
$16500
March
$21800
$21200
April
$23800
$21200
May
$29600
$24500
June
$27600
$21800
 
The converted XML data is shown below. We will save it as Data_multi.xml and put it within the src folder.
 
<chart caption='Business Results 2005 v 2006' xAxisName='Month' yAxisName='Revenue' showValues='0' numberPrefix='$'>

   <categories>
      <category label='Jan' />
      <category label='Feb' />
      <category label='Mar' />
      <category label='Apr' />
      <category label='May' />
      <category label='Jun' />      
   </categories>

   <dataset seriesName='2006'>
      <set value='27400' />
      <set value='29800'/>
      <set value='25800' />
      <set value='26800' />
      <set value='29600' />
      <set value='32600' />
     
   </dataset>

   <dataset seriesName='2005'>
      <set value='10000'/>
      <set value='11500'/>
      <set value='12500'/>
      <set value='15000'/>
      <set value='11000' />
      <set value='9800' />
     
   </dataset>   

</chart>
 

You can build the chart either from Design view or by entering code in Source view. To build a chart in Design view follow the instructions provided in "Your First Chart > Simple Seles Chart" section.

Here, we'll have just to set the value of FCChartType and FCDataURL to 'MSColumn3D' and 'Data_multi.xml' respectively.

Use the following code to build the chart in Source view:

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="com.fusioncharts.components.*">
    <ns1:FusionCharts x="10" y="10" FCDataURL="Data_multi.xml" FCChartType="MSColumn3D"/>
</mx:Application>

 
In the code, we have only changed the chart type and provided appropriate chart data. That's it! Now, run the code. You will get a multi-series Column 3D chart as shown below.