You are viewing documentation for an older version. For current documentation - click here.

Using the Export Component JavaScript object, you can also over-ride the export parameters that you've specified for each chart in XML. This is particularly useful in particular scenarios:

  • When your XML has parameters related to server-side export (say saving on server-disk) to be used by some part of code in that page. But if you also want your user to be able to instantly download a snapshot of the chart (using client-side exporter) by calling another routine. In this case, when the user clicks on a button, you can over-ride the export parameters specified in the XML (set exportAtClient to 1, specify client-side exportHandlers) and then start export routine.
  • When in a batch mode, you do not want the charts to show Export Dialog box. You can then over-ride the show dialog box property at run-time, thereby eliminating the need to specify the same in XML. So, when users export individual charts, they do see the dialog box. But, when your batch process starts, the dialog can be hidden, thereby enabling the process to carry on silently in the background.
  • Change call-backs at run-time, depending on your application
  • Change export format and file name at run-time, if needed

The list of parameters that can be over-ridden this way is as under:

Attribute Name Value Type Description
string In case of server-side exporting, this refers to the path of the server-side export handler (the ready-to-use scripts that we provide).

In case of client-side exporting, this refers to the DOM-Id of FusionCharts Export component that is embedded in your web page, along with the chart.

Whether to use client-side export handlers, or server-side export handlers.

Note: By default the value is set to 0 which means the export is supposed to be done at server-side.

Whether to show the export dialog during capture phase. If not, the chart starts capturing process without the dialog visible.
('PNG' / 'JPG' / 'PDF')
You can choose the format in which the chart is exported.
string Using this attribute you can specify the name (excluding the extension) of the file to be exported.

When server-side–save export is specified this attribute must provide the relative path of the destination file that is going to be saved to the server.
e.g. “../gallery/charts/myExpenseChart”

('download' / 'save')
In case of server-side exporting, the action specifies whether the exported image will be sent back to client as download, or whether it'll be saved on the server.

Note: This is only available for server-side export.

('_self' / '_blank')
In case of server-side exporting and when using download as action, this lets you configure whether the return image/PDF will open in the same window (as an attachment for download), or whether it will open in a new window.

Note: This is only available for server-side export.

string This attribute specifies the name of the callback JavaScript function which will be called when the export event is complete.

The internal JavaScript function FC_Exported is the default method that will be called when no value is specified.

An Example

Let's quickly see an example of how to hide the Export dialog box of all charts during a batch process. To do so, we just add the following line to our export component code:

<script type="text/javascript">
	//Initialize Batch Exporter with DOM Id as fcBatchExporter
	var myExportComponent = new FusionChartsExportObject("fcBatchExporter", "../../Charts/FCExporter.swf");
	//Add the charts to queue. The charts are referred to by their DOM Id.
	myExportComponent.sourceCharts = ['myChartId1','myChartId2','myChartId3','myChartId4'];
	//------- Export related Attributes ------//
	myExportComponent.exportAttributes.showExportDialog = '0';
	//------ Export Component Attributes ------//
	//Set the mode as full mode
	//Set saving mode as both. This allows users to download individual charts/ as well as download all charts as a single file.
	//Show allowed export format drop-down
	myExportComponent.componentAttributes.showAllowedTypes = '1';
	//Width and height
	myExportComponent.componentAttributes.width = '350';
	myExportComponent.componentAttributes.height = '140';
	//Message - caption of export component
	myExportComponent.componentAttributes.showMessage = '1';
	myExportComponent.componentAttributes.message = 'Click on button above to begin export of charts. Then save from here.';
	//Render the exporter SWF in our DIV fcexpDiv

See it live!

As you can see above, the format is:


When you run the above example and initiate batch export, you'll see that the capturing phase does not show the export dialog any more. This saves you the trouble of specifying the parameter in each chart's XML.