Here, we'll see all the APIs exposed by data-streaming charts - the one which we've discussed previously and the ones which we've not.

 
Function Name Parameter Description
FusionWidgets general JavaScript API
setDataURL(strURL) strURL Sets the chart to update its data from the specified URL
setDataXML(strXML) strXML Sets the chart to update its data from the given string containing XML data
     
Data-streaming chart related APIs
feedData(strData) strData This method feeds incremental data-stream to chart using JavaScript. The data stream has to be in the same format as provided by real-time data provider page.
getData() None This method returns the current data being shown on the chart as a JavaScript array.
stopUpdate() None This method stops the chart from self-updating itself.
restartUpdate() None If you've stopped the update of the chart, you can resume the update using this method.
clearChart() None This method clears the data currently being shown on the chart and sets the chart canvas afresh.
     
Message logger related APIs
showLog() None This method shows the message logger, if it was previously hidden.
hideLog() None This method hides the message logger, if it's visible.
clearLog() None This method clears the message log contents.
Additionally, you can control the annotations using JavaScript API, which has been discussed in the annotations sections.
 
Troubleshooting

While accessing any of the JavaScripts methods listed above, if you get an error like "... is not a function of ...", make sure of the following points:

  • You've set registerWithJS flag as 1 in the chart's constructor method.
  • You've not placed the chart inside a FORM element. When the chart is inside a FORM element, the browser cannot access the chart using DOM.
  • Make sure that you're not calling the JavaScript method before the chart has loaded and rendered. You need to use FC_Rendered function of chart to track the loading of chart as explained in the section "FusionWidgets and JavaScript"
  • Make sure that you're NOT running the chart from local file system (C:\ , D:\). Instead, run the chart from behind a server (localhost - IIS, Apache etc.). This is because the Flash Player security settings do not allow chart to JavaScript interaction on local file system by default, unless otherwise specifically set.