FusionCharts for Flex > Chart Creation > Combination Charts > Data from URL

In this section we will discuss how to build a Combination chart using external XML file.

 
Before you continue, we recommend that you go through "Your First Chart" section, as we start off from the concepts explained in that section.
 
Following XML will be used for constructing the combination chart, this XML is saved in a file named Data_combi.xml:
 
This XML file contains sales data of 3 years -2004, 2005 and 2006. Each year would be a single type of chart. 2006 would be shown in a column chart, 2005 as an area and 2004 as  a line.
 

<chart caption='Business Results 2004 vs 2005 vs 2006' xAxisName='Month' 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' renderAs='Area'>
      <set value='10000'/>
      <set value='11500'/>
      <set value='12500'/>
      <set value='15000'/>
      <set value='11000' />
      <set value='9800' />
   </dataset>

   <dataset seriesName='2004' renderAs='Line'>
      <set value='7000'/>
      <set value='10500'/>
      <set value='9500'/>
      <set value='10000'/>
      <set value='9000' />
      <set value='8800' />
   </dataset>

</chart>

 
To create the chart from Design view you'll have to set the value of FCChartType and FCDataURL to 'MSCombi2D' and 'Data_combi.xml' respectively. To build the chart from Source view, you can use the following code:
 

<?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_combi.xml" FCChartType="MSCombi2D"/>
</mx:Application>

 
The following chart will be rendered upon execution of the code: