Starting FusionCharts for Flex v1.1, all charts and widgets of FusionCharts for Flex v.1.1 package are provided with a feature that exports the charts and widgets to image or PDF at client side. The exported files types can be any of the three formats - JPG, PNG or PDF. This just involves setting a few attributes of the chart/widget data. Export can be initiated in following two ways:
The image below shows the export feature in action using context menu.
Or if you wish to use Flex script to export, you would need to create a button or some clickable object and call the FCExportChart function of the chart/widget. The code below exports a chart/widget whose id is myChart to a JPG image.
<mx:Button ... click="myChart.FCExportChart('myChart', 'JPG')" />
In following pages we will discuss the chart/widgets attributes that are involved in configuring the export mechanism. Moreover, we will learn using detailed samples how export is done either using context menu or Flex script. We will finally learn the callback event triggered when export completes.
Please note that the following components are required for avail the export feature :
If you want to invoke the export utility from Flex, you need to compile your project in Flex SDK 3.3.0 or above. You can get the SDK from http://www.adobe.com/products/flex/flexdownloads/.
Adobe Flash Player 10 is required for the export component. If your system does not have Adobe Flash Player, you can acquire it from www.adobe.com/products/flashplayer/.