mfreake

Members
  • Content count

    1
  • Joined

  • Last visited

About mfreake

  • Rank
    Forum Newbie
  1. In my javascript code I am dynamically creating divs and appending charts to them using jQuery based on user actions. The user can also cause the charts to be removed. I'm doing this like so (where this._chartsDiv is a jQuery object containing a parent div for all charts to be put in and xml is a local variable containing the chart xml data): var chart = $("<div>"); this._chartsDiv.append(chart); chart.insertFusionCharts({ swfUrl: "Charts/StackedColumn2D.swf", width: "300", height: "250", wMode: "transparent", dataFormat: "xml", dataSource: xml }); I also sometimes update an existing chart like so: this._chartsDiv.children().eq(i) .updateFusionCharts({ dataSource: xml }); My problems occur while trying to remove charts: this._chartsDiv.children().eq(i).remove(); If I quickly try to add and remove charts I will usually get the following error (where the ID is some form of chartobject-X): try { document.getElementById("chartobject-1").SetReturnValue(__flash__toXML(FC_Rendered("chartobject-1")) ); } catch (e) { document.getElementById("chartobject-1").SetReturnValue("<undefined/>"); } It would be very difficult for me to set IDs on the divs or the charts and guarantee they are unique, so I'm hoping there's a solution that doesn't involve that. I'm also wondering if it's because there is no way to destroy or dispose of a chart through jQuery, is that possibly the problem? Is calling the javascript dispose method possible given that the chart is created through jQuery? Thank you.