Creating your first chart > The Communication Logic
 
In the previous example, you had seen how to use FusionCharts to build a simple chart. Well, its time now to know what actually happened behind the scenes that involved the three elements (the SWF File, XML File and the HTML file) to plot the chart.

The data communication in FusionCharts can be broken into the following steps:

  • The HTML wrapper page in which FusionCharts is embedded sends the Data Source URL to FusionCharts via the Object/Embed method (i.e., by appending the Data Source URL as in a querystring to the end of the file name FC2Column.swf)
<HTML>
<HEAD>
<TITLE>FusionCharts Sample Chart</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<CENTER>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/
pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="565" HEIGHT="420" id="FC2Column" ALIGN="">
<PARAM NAME=movie VALUE="../Charts/FC2Column.swf?dataUrl=Data.xml">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="../Charts/FC2Column.swf?dataUrl=Data.xml" quality=high bgcolor=#FFFFFF WIDTH="565" HEIGHT="420" NAME="FC2Column"
ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
</CENTER>
</BODY>
</HTML>
  • FusionCharts receives the Data Source URL, filters it and then sends a request to the URL to send the XML Content. In the filtering process, FusionCharts converts the URL ladded with *s (we'll soon see this) back to its original format and then sends a request to load the XML file.
  • The Page at Data Source URL receives the request to serve XML Content. It queries the database or files, does the processing work, generates an XML Document and sends it to the output stream.
  • FusionCharts receives the XML Content from the page at Data Source URL, parses it and then displays the graph according to the parameters and data contained in the XML Document.
The diagram below would help you visualize the process better: