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

In our 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 use the same data in the coming sections as well.

 
Before you go further, we recommend you to see the section "Your First Chart" , as we start off from the concepts explained in that page.
 
Creating the XML data document for the Chart
Here, we will build a Multi-series Column 3D chart. Our data table would look as under:
 
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 store it inside 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>
 

We can build the chart either from design view or by entering into the source view. In the design view, we can build the chart following the way described in the page "Creating Charts » Single Series" section. Here, we need to set the value for FCChartType and FCDataURL as MSColumn3D and Data_multi.xml respectively. However, if you wish to do the same from the source view, the following code would help you out.

 

<?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>

 
As you can see above, we have only changed the chart type and provided appropriate chart data. That's it. Now, if you run the code, you will get a multi-series Column 3D chart as the image below shows.