Creating your first chart > Creating the HTML Page
 

Creating the HTML Page
To include a FusionCharts chart in your page, you'll need to have the following HTML Code.

<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>

Save this page as MyFirstChart.html in the folder which we had just created.

In the above code, <OBJECT> and <EMBED> tags have been used to embed FusionCharts Column Chart (FC2Column.swf) within the HTML page. Also, notable is the string ?dataUrl=Data.xml after the SWF name. This string (actually referred to as dataURL method of providing data to FusionCharts) indicates FusionCharts the source to pull the data from – Data.xml in this case.

To display correctly a Flash movie in a browser, HTML page should contain specific tags that specify the Flash movie file to be opened and played. There are two tags which are intended for it: <OBJECT> and <EMBED> tags.

These two tags are required to display a Flash movie in different Internet browsers properly. The <OBJECT> tag is used by Internet Explorer under Microsoft Windows and the <EMBED> tag is used by Netscape Navigator under Microsoft Windows or Mac OS. Each of these two tags acts in the same way, however using only one tag may cause incompatibility of one of the browsers. To ensure that most browsers will play your Flash movies, you should place the <EMBED> tag nested within the <OBJECT> tag as shown in the example. ActiveX-enabled browsers will ignore the <EMBED> tag inside the <OBJECT> tag. Netscape and old Microsoft browsers will not recognize the <OBJECT> tag and will use only the <EMBED> tag to load the Macromedia Flash Player.

Next, we’ll see the creation of the XML data document - Data.xml.