Extending your Charts > Additional Parameters |
Till now you had seen how to control and manipulate
the graph functionality and looks by passing attributes via the XML data
source. But, there’s more to it – there’s another way
of changing the internal coded values in FusionCharts by using the OBJECT/EMBED
method. Say, for example, you wished to change the shadow depth of the pie
chart – you can’t do this using the XML data source –
however the same can be done by passing a hidden value through the OBJECT/EMBED
tag.
Let’s first have a look at how we can pass data through the OBJECT/EMBED tag. Consider the following HTML code: |
<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="FusionCharts" ALIGN=""> <PARAM NAME=movie VALUE="FC2Column.swf?dataURL=MyData.asp&legendBoxWidth=200&legendBoxHeight=120"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="FC2Column.swf?dataURL=MyData.asp&legendBoxWidth=200&legendBoxHeight=120" quality=high bgcolor=#FFFFFF WIDTH="565" HEIGHT="420" NAME="FusionCharts" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT> |
Here, in the above code, we provide the following parameters
to the graph: dataUrl legendBoxWidth
(with value as 200) and legendBoxHeight
(with value as 120).
So, now let’s get rolling and see the various hidden attributes for each graph. |
Column 3D/ Line/ Area Chart
|
Pipe Chart |
For the pipe chart, we have the following additional parameters
along with the ones earlier discussed for Column Chart:
|
Pie Chart |
For the pie chart, we have the following additional OBJECT/EMBED parameters:
So, now let’s get on with the customization of a pie chart. We first intend to do the following:
To do this, we’ll have to alter our HTML code to the following: |
<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="FC2Pie3D" align="middle"> <param name=movie value="FC2Pie3D.swf? dataURL=Pie3D3.xml&PieOriginx=390&legendBoxX=90"> <param name=quality value=high> <param name=bgcolor value=#FFFFFF> <embed src="FC2Pie3D.swf? dataURL=Pie3D3.xml&PieOriginx=390&legendBoxX=90" quality=high bgcolor=#FFFFFF width="565" height="420" name="FC2Pie3D" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed> </object> |
You’ll get the following output: |
Similarly, if we wanted the pie slices to cover the entire area of the chart and to hide the legend box, we would have to write the following code: |
<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="FC2Pie3D" align="middle"> <param name=movie value="FC2Pie3D.swf? dataURL=Pie3D2.xml&showLegend=0&pieOriginX=300&xRadius=150"> <param name=quality value=high> <param name=bgcolor value=#FFFFFF> <embed src="FC2Pie3D.swf? dataURL=Pie3D2.xml&showLegend=0&pieOriginX=300&xRadius=150" quality=high bgcolor=#FFFFFF width="565" height="420" name="FC2Pie3D" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed> </object> |
And, the output would have been as under: |