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
The column chart supports the following OBJECT/EMBED parameters:

  • shadowDarkIntensity: This attribute sets the intensity for the medium dark shadows. Its default value is 0.80. If you increase this value, the shadow will become lighter.
  • shadowDarkerIntensity: This attribute sets the intensity for the darkest shadows. Its default value is 0.65. If you increase this value, the shadow will become lighter and vice-versa.
  • plotAreaLeftMargin: This attribute indicates the left space (in pixels) on the canvas to be left unfilled while plotting the chart.
  • plotAreaRightMargin: This attribute indicates the right space (in pixels) on the canvas to be left unfilled while plotting the chart.
  • stageWidth: The width of the entire stage (default - 565).
  • plotAreaWidth: The width of the plotting area i.e., the entire grid.
  • plotAreaHeight: The height of the plotting area i.e., the entire grid.
  • spacingArea: Total spacing area available on the canvas. If you increase this value, the columns will become thinner and vice versa.


Pipe Chart

For the pipe chart, we have the following additional parameters along with the ones earlier discussed for Column Chart:
gradientShadowIntensity: The shadow intensity of the gradient.

  • lineGradientLightColor: The light gradient color of the pipe – by default FFFFFF.
  • shadowXShift: The shift in x-position for the shadow – by default 10.
  • shadowYShift: The shift in y-position for the shadow – by default 10.
  • shadowColor: The color of the shadow – by default CCCCCC.
Pie Chart

For the pie chart, we have the following additional OBJECT/EMBED parameters:

  • sliceSpacingDistance: If a pie segment is sliced, then this value determines the distance of the slice from other segments.
  • shadowDepth: The depth of the pie shadow in pixels – by default 12.
  • yRadiusScale: The y-radius scale (determines the angle of inclination for pie set) – by default 70
  • xRadius: The radius of each pie in pixels – by default 100
  • pieOriginX: The X origin in pixels – by default 200
  • pieOriginY: The Y origin in pixels – by default 270
  • nameTbDistance: Distance of the value textbox from the pie segments in pixels – by default 25
  • showLegend: Option to show/hide the legend – accepts 1/0.
  • legendBoxX: X co-ordinate of the legend box – by default 340
  • legendBoxY: Y co-ordinate of the legend box – by default 80
  • legendBoxHeight: Height of the legend box – by default 220
  • legendBoxWidth: Width of the legend box – by default 175
  • legendBoxItems: Number of data items to be displayed in the legend box – by default 8
  • legendItemHorSpacing: The horizontal spacing factor (in pixels) between the legend box walls and the data items – by default 5
  • legendItemVerSpacing: The vertical spacing factor (in pixels) between the legend box walls and the data items or between two data items– by default 5
  • navBtnSpacingX: The horizontal spacing factor (in pixels) between the legend box walls and the data table navigation buttons– by default 3

So, now let’s get on with the customization of a pie chart. We first intend to do the following:

  1. Shift the pie to the right of the canvas
  2. Shift the legend box to the left of the pie.

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: