## JavaScript APIs exposed by the chart
All the charts in FusionCharts v3 suite expose the following JavaScript APIs. Click on a method name to see detailed usage information on the same. Please note that the events are raised only when registerWithJS flag of the chart is set to 1. These APIs are NOT present in FusionCharts.js (FusionCharts JavaScript class). Rather, these APIs are in-built into the SWFs. So, you need to invoke them on the DOM object of the chart (i.e., on the object returned by getChartFromID(DomID) call).
API Method signature | Purpose | What it returns?
setDataURL(strDataURL:String) | Changes the data of the chart to the new specified URL. The URL has to be relative to the chart. | Nothing
setDataXML(strDataXML:String) | Changes the data of the chart to the specified XML string. Note of caution: When specifying XML as string, please make sure that there are no conflicts in quotes between the JS function call and the quotation mark used to enclose attributes in XML string. | Nothing
print() | Prints the chart | Nothing
exportChart(exportSettings: Object) | Calls the export chart routine to save the chart as PDF/image. exportSettings object here contains over-riding parameters to over-ride the export parameters initially specified in XML. | Nothing. But, in most cases, a callback function is invoked to convey status of export.
getXML() | Returns the XML data of chart. | XML data of chart as string
getChartAttribute(attrName: String) | Returns the value of the attribute as specified in chart's XML data > <chart> element | Value of the attribute; or "null" if the attribute was empty or not found in XML
signature() | A string representing the signature of SWF. | For FusionCharts v3 charts, it's FusionCharts/3.1
hasRendered() | A boolean value indicating whether the chart has rendered. | Boolean value indicating whether the chart has finished rendering
getDataAsCSV() | Returns the data of chart as CSV string. The output CSV string can be configured using XML parameters. | String representing data of chart in CSV format.