JavaScript Coding for Charts



Fusion Charts API

Fusion Charts provides a variety of JavaScript APIs that can be used to interact with the charts, maps, and other widgets. To use the Fusion Charts API it's necessary to get a reference to the Fusion Charts JavaScript object that represents a specific widget. This can be done using a simple JavaScript call from the Rich Display File or Genie screen's "onload" event. 

For example:

// Pass the Profound UI widget id with "_Chart" appended. // This example works for a widget with id "Chart1".   var fc = FusionCharts("Chart1_Chart");



The Fusion Charts APIs are used by calling methods of the object in the example above. See the Fusion Charts API documentation for specifics.

The following example uses the "addEventListener" API method to add a "dataplotClick" event to a widget with id "Chart1". The "dataplotClick" event fires when the user clicks on a data portion of the widget. The event handler receives information about the data at the clicked coordinate.

var fc = FusionCharts("Chart1_Chart"); fc.addEventListener("dataplotClick", function(e, data) {   console.log(arguments);   });