Loading

The export feature of FusionCharts XT can be enabled by setting the value of exportEnabled to 1.
The export button will now appear on the top right corner of the chart. An image of the button can be seen as follows:

image

Name Description

exportEnabled

This attribute gives you the option to allow exporting to images/PDFs.



Clicking the export button will display the export menu, which contains a list of all the possible formats the chart can be exported to.

image



A number of other features can also be configured like the name of the exported file and the display text for each format that is supported. A chart with these options configured can be seen below:

FusionCharts will load here..



Given below are the attributes used to configure the export options in the chart above:

Name Description

exportEnabled

This attribute gives you the option to allow exporting to images/PDFs.

exportFormats

This attribute accepts the format to which the chart will be exported. Custom labels which appear to the user for each type can also be provided. Example:
“exportFormats”: “PNG=Export as High Quality PNG | PDF=Export as PDF File”

exportTargetWindow

In case of Private Export Server and when using download as action, this attribute 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.

exportFileName

This attribute lets you specify the name (excluding the extension) of the output (export) file.

The data structure needed to configure the export menu as above is given below:

{ "chart": { "caption": "Monthly Revenue", "subCaption": "Last year", "xAxisName": "Month", "yAxisName": "Amount (In USD)", "numberPrefix": "$", "canvasBgAlpha": "0", "bgColor": "#DDDDDD", "bgAlpha": "50", "theme": "fint", "exportEnabled": "1", "exportFormats": "PNG=Export as High Quality Image|JPG|PDF=Export as PDF File", "exportTargetWindow": "_self", "exportFileName": "Monthly_Revenue" }, "data": [ { "label": "Jan", "value": "420000" }, { "label": "Feb", "value": "810000" }, { "label": "Mar", "value": "720000" }, { "label": "Apr", "value": "550000" }, { "label": "May", "value": "910000" }, { "label": "Jun", "value": "510000" }, { "label": "Jul", "value": "680000" }, { "label": "Aug", "value": "620000" }, { "label": "Sep", "value": "610000" }, { "label": "Oct", "value": "490000" }, { "label": "Nov", "value": "900000" }, { "label": "Dec", "value": "730000" } ] }
{
    "chart": {
        "caption": "Monthly Revenue",
        "subCaption": "Last year",
        "xAxisName": "Month",
        "yAxisName": "Amount (In USD)",
        "numberPrefix": "$",
        "canvasBgAlpha": "0",
        "bgColor": "#DDDDDD",
        "bgAlpha": "50",
        "theme": "fint",
        "exportEnabled": "1",
        "exportFormats": "PNG=Export as High Quality Image|JPG|PDF=Export as PDF File",
        "exportTargetWindow": "_self",
        "exportFileName": "Monthly_Revenue"
    },
    "data": [
        {
            "label": "Jan",
            "value": "420000"
        },
        {
            "label": "Feb",
            "value": "810000"
        },
        {
            "label": "Mar",
            "value": "720000"
        },
        {
            "label": "Apr",
            "value": "550000"
        },
        {
            "label": "May",
            "value": "910000"
        },
        {
            "label": "Jun",
            "value": "510000"
        },
        {
            "label": "Jul",
            "value": "680000"
        },
        {
            "label": "Aug",
            "value": "620000"
        },
        {
            "label": "Sep",
            "value": "610000"
        },
        {
            "label": "Oct",
            "value": "490000"
        },
        {
            "label": "Nov",
            "value": "900000"
        },
        {
            "label": "Dec",
            "value": "730000"
        }
    ]
}

Experimental Feature: Export with Logo Image

Currently, using the FusionCharts export handler, when a chart having a custom logo is exported as an image, the logo is not present in the generated image. We are introducing an experimental feature, which allows the logo present in the chart to be exported as well and be displayed in the resultant image.

To use this feature, set exportEnabled to 1, and set exportHandler to the url http://export.api3.fusioncharts.com/logo/. Using this exporter, the generated output will contain the logo alongwith the chart. Note that this is an experimental feature and thus might not be a completely reliable solution.



The following is a complete list of chart level attributes that can be used to enable and configure exporting as an image or pdf:

Attribute Name Type Range Description

exportEnabled

Boolean

0/1

This attribute gives you the option to allow exporting to images/PDFs.

exportShowMenuItem

Boolean

0/1

This attribute gives you the option to allow the menu items related to export (for example, Save as JPEG etc.) to appear in the context menu of chart.

exportFormats

String

List of formats that can be exported to. Custom labels which appear to the user for each type can also be provided. Example: “exportFormats”: “PNG=Export as High Quality PNG | PDF=Export as PDF File”

exportAtClient

Boolean

0/1

This attribute gives you the option to use Private Export Server, by giving it the value 0.

exportHandler

String

In case of a Private Export Server, this refers to the path of the Export Handler (the ready-to-use scripts that we provide). Make sure to provide the file name along with the path. In case of Client-side exporting, this refers to the DOM Id of the FusionCharts Export Component that is embedded in your web page, along with the chart.

exportAction

String

‘save’ or ‘download’

In case of Private Export Server, the action specifies whether the exported image will be sent back to client as download, or whether it will be saved on the server.

exportTargetWindow

String

_self or _blank

In case of Private Export Server and when using download as action, this lets you configure whether the return image/PDF will open in same window (as an attachment for download), or whether it will open in a new window.

exportCallback

String

Name of JavaScript function that will be called when export process has finished.

exportFileName

String

Using this attribute you can specify the name (excluding the extension) of the output (export) file.

Top