Implementation Methods > PHP/CF/CGI/Perl Implementation |
Analogically, using FusionCharts with PHP/CF/CGI/Perl
is very similar to using it with ASP/ASP.NET, but for the changes in data
connection and retrieval modules.
In this part, we will discuss the modal integration of FusionCharts with
PHP/CF/CGI/Perl. We wouldn’t go much into the code level of these
scripting languages. You can use either of the two methods mentioned below to provide data to FusionCharts:
So, let’s first see the dataURL way with PHP/CF/CGI/Perl. With either of the aforementioned languages, you need to have two pages:
Let’s now study an analogical model for this mode. We consider
Graph.html to be the page which contains the graph object. It contains
the normal HTML code as usual: |
<HTML> <HEAD> <TITLE>FusionCharts ASP 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=5,0,0,0" WIDTH="565" HEIGHT="420" id="FCColumn" ALIGN=""> <PARAM NAME=movie VALUE="FC2Column.swf?dataUrl=ProvideData.php*Param1=Value1*Param2=Value2"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="FC2Column.swf?dataUrl= ProvideData.php*Param1=Value1*Param2=Value2" quality=high bgcolor=#FFFFFF WIDTH="565" HEIGHT="420" NAME="FCColumn" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED> </OBJECT> </CENTER> </BODY> </HTML> |
As you can see above, we have mentioned ProvideData.php as the data provider page and to this page we have passed two parameters (as QueryString) namely Param1 (with value as Value1) and Param2 (with value as Value2). |
Now, getting to ProvideData.php – this page’s main function is to request the data sent to it as QueryString, interact with the database (if required) and then format and output the XML string required by FusionCharts. The task can be broken down into the following steps: |
|
That’s all you need to do to have FusionCharts work with your PHP/CF/CGI/Perl script in the dataUrl way. |
The dataXML way |
Now, if you want to use dataXML way to provide data to FusionCharts, your page structure would look something as under: |
|