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

In this section we will show you how to build Combination chart using external XML file.

 
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.
 
Our sample XML for 2D Single Y Combination chart is given below. Here we will save our XML data as Data_combi.xml and store it inside the "src" folder.
 

<chart caption='Business Results 2005 v 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>

 
Now, we will build the chart. We can do it either from the design view or source view. Here we set the value for FCChartType and FCDataURL to MSCombi2D and Data_combi.xml respectively. If you want 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>

 
Now, if you run the code, you will see the following figure.