Configuring Chart Data > XML File

FusionCharts uses custom XML for chart configuration. Using FusionCharts XML you can not only configure chart data, but also define various cosmetic properties of the chart. To learn more about FusionCharts XML visit http://www.fusioncharts.com/docs. The following are examples of XML's for Single Series and Multi Series Charts..

<chart>
   <set label='Jan' value='420000' />
   <set label='Feb' value='910000' />
   .....
   <set label='Nov' value='530000' />    
   <set label='Dec' value='330000' /> 
</chart>

 

<chart>    
   <categories>       
   <category label='Jan' />       
   <category label='Feb' />       
   .....       
   <category label='Nov' />       
   <category label='Dec' />    
</categories>    
   <dataset seriesName='2006'>       
      <set value='27400' />      
      <set value='29800' />      
      .....       
      <set value='34800' />       
      <set value='24800' />
   </dataset>
   <dataset seriesName='2005'>
      <set value='10000' />
      <set value='11500' />
      .....       
      <set value='22900' />
      <set value='20800' />
   </dataset>
</chart>

The process of linking the XML file is very simple. Firstly, ensure that the 'Import XML' option is selected. Now, provide the path to the desired XML file either manually or by using the 'Browse' button and then click the 'load' button in order to link the XML file to your chart. In case your XML file is located outside the site's root directory, you will be prompted to save it within the root directory (saving the file within the root is not mandatory). However it is recommended that the file be present within the site's root folder. After you have linked the XML file, you would notice the data from the XML file gets displayed on the 'Data Grid' screen in a tabular form. Using this data configuration method saves you the trouble of defining Categories and Series as they get defined automatically.

You can create an XML file by directly retreiving data from a database. For this, you can use the recordset feature of Dreamweaver. To learn about the recordset feature, visit the recordset tutorial.