As you must already be aware by now, FusionCharts accepts only XML data to plot the charts. You can either provide physical XML data files or dynamically relay XML data using server-side scripts to FusionCharts. Here, we explore the various methods using which you can provide XML data to FusionCharts.

Please note that you do NOT ever need to save physical XML files on your server. When generating dynamic charts from your database, the XML files are built in memory (variables) using string concatenation or our API methods, and then dynamically relayed (written to output stream, like other HTML content).

There are 4 ways using which you can provide XML data to FusionCharts:

  1. dataURL method - In this method, you only provide the URL of XML Data Document to FusionCharts. The chart now sends a request for XML data to the specified URL, reads it, parses it and then renders the charts accordingly.
  2. dataXML method - Here, you send the XML data along with the HTML Content and chart SWF file to the browser. The SWF loads, reads this data (present in same HTML page) and then renders the chart.
  3. JavaScript method using setDataXML - In this method, you provide the XML data to FusionCharts using JavaScript functions (present on the same page in which chart is present).
  4. JavaScript method using setDataURL - In this method, you provide the URL of the XML data document to FusionCharts using JavaScript functions present on the same page in which chart is present. The chart now sends a request for XML data to the specified URL, reads it, parses it and then renders the charts accordingly.

Let's discuss each method in details next or click the button below to see an animated feature tour.