-2

I am using fusionchart and I wasn't able to use the addEventListener function. It's throwing me JavaScript error. In this JavaScript file the chart is loading and working fine if I remove the addEventListener function..

I have downloaded another fusioncharts_latestdownload.js file from the site. The addEventListener function is working in this new file but the chart is not getting loaded Please help me out to solve this issue.

navbingo
  • 223
  • 1
  • 6
  • 24
  • 1
    Sorry, but my crystal ball isn't working tonight. Guess I'll have to get it tuned up _again_ – Matt Ball Jun 24 '11 at 06:22
  • 1
    Could you please post the relevant code here so that it can be tested? – Sanjukta Mukherjee Jun 24 '11 at 12:21
  • @Sanjukta : please check this link..i have attached the js files in that forum..http://forum.fusioncharts.com/topic/9848-in-fusionchartjs-could-not-able-to-use-addeventlistener/#entry38462 – navbingo Jun 28 '11 at 09:18

1 Answers1

1

FusionCharts allows you to set event listeners in charts (swf/js) built since v3.2. So, please check if you are using charts having version 3.2 or above.

Moreover, please also check if you have FusionCharts.js which is of v3.2 or above.

More pointers on adding event listeners:

  1. Make sure to use the appropriate variable name/js reference of the chart.

    var myChart = new FusionCharts(...);
    myChart.addEventListener ("DrawComplete" , myChartListener );

Basic Documentation : http://www.fusioncharts.com/docs/?JavaScript/JS_EventOverview.html#advanced

API Reference : http://www.fusioncharts.com/docs/?JavaScript/API/Events.html

  1. You can also use other chart reference models like:

    FusionCharts("myChartId").addEventListener("DrawComplete" , myChartListener); getChartFromId( DOMId ).addEventListener("DrawComplete" , myChartListener); FusionCharts.items["myChartId"].addEventListener("DrawComplete" , myChartListener);

You can also check out samples from :

http://www.fusioncharts.com/code/JavaScript/Basics/ListeningToEvents/Using_JavaScript_advanced_event_registration_model.html

Menu containing other examples of FusionCharts JavaScript API : http://www.fusioncharts.com/code/JavaScript/index.html

sudipto
  • 2,472
  • 1
  • 17
  • 21