siwel_nerrad Report post Posted August 9, 2007 Hi, I have bound a powerchart to some XML and it displays the chart fine. What I now want to do is to retrieve the current XML data back from the chart but I cannot seem to get this working. I have viewed the online demo at http://www.fusioncharts.com/Demos/ScatterReturn/Default.html and that is what I want to achieve, but when I download the source it doesn't work. I am programming this in ASP.net 2.0 and C# using masterpages and here is my code: <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <script language="JavaScript" src="<%=Request.ApplicationPath %>/Javascript/FusionCharts.js"></script> <script language="JavaScript"> /** * readXMLFromChart() method is called when the user pressed the * button to return XML data */ function test() { //Get a reference to our chart var ourChart = getChartFromId("SelectChart"); //Get the data from chart var xmlRtn = ourChart.getXMLData(); //Show it to user in alert box. alert(xmlRtn); } </script> <table width='98%' border ='0' cellspacing='0' cellpadding='3' align='center'> <tr> <td valign='top' class ='text' align='center'> <div id="chartdiv" align="center"> FusionCharts. </div> <script type="text/javascript"> var chart = new FusionCharts("DragNode.swf", "SelectChart", "550", "400", "0", "1"); chart.setDataXML("<%=XmlFC %>"); chart.render("chartdiv"); </script> </td> </tr> <tr> <td> <input id="Button1" type="button" value="button" onclick="test();" /> </td> </tr> </table> </asp:Content> Any suggestions?? Share this post Link to post Share on other sites
Pallav Report post Posted August 14, 2007 Do you get any JavaScript errors when you run this code? Share this post Link to post Share on other sites
ssanand Report post Posted February 15, 2008 Hi, I'm having the same problem. I'm getting "object doesnot support this method" java script error when accessing getXMLData() method. Any help? Regards, Anand Share this post Link to post Share on other sites
Arindam Report post Posted February 15, 2008 Are you using the chart with in form? then use the latest FusionCharts.js Share this post Link to post Share on other sites
ssanand Report post Posted February 15, 2008 Thanks for the Reply. I think the problem is, I Share this post Link to post Share on other sites
Pallav Report post Posted February 15, 2008 Even with HTML rendering, you can access. You need to then make sure that you've specified correct flags like renderWithJS=1 Share this post Link to post Share on other sites
neandegor Report post Posted April 29, 2008 Hi... first sorry by my english.. .. I speak spanish.. but i'll try to response this question.. this is the trick... when you create the chart.. you set the values... swfpath, graphname, width, heigth, DEBUG, this last one makes you can retreive the XML with getXML().. var chart = new FusionCharts("swfpath", "graphname", w, h, "0", "1" ); this method don't work with all the charts.. SALUDOS! Share this post Link to post Share on other sites