|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 8/10/2007 3:14:48 AM
Posts: 1,
Visits: 5
|
|
| 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 chartvar 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??
|
|
|
|
|
FusionCharts Team
      
Group: Administrators
Last Login: 7/29/2008 12:15:49 PM
Posts: 2,001,
Visits: 474
|
|
Do you get any JavaScript errors when you run this code?
Thanks, Pallav Nadhani FusionCharts Team
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 2/16/2008 2:33:08 AM
Posts: 5,
Visits: 11
|
|
| 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
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: Today @ 4:28:13 AM
Posts: 229,
Visits: 1,174
|
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 2/16/2008 2:33:08 AM
Posts: 5,
Visits: 11
|
|
Thanks for the Reply. I think the problem is, I’m using HTML chart declaration and trying to access the chart data using JavaScript. Seems this is not possible. I've changed the chart creation to JavaScript and now i have no problems in accessing getXMLData() method. I'm not sure this is the expected functionality of power charts Anand
|
|
|
|
|
FusionCharts Team
      
Group: Administrators
Last Login: 7/29/2008 12:15:49 PM
Posts: 2,001,
Visits: 474
|
|
Even with HTML rendering, you can access. You need to then make sure that you've specified correct flags like renderWithJS=1
Thanks, Pallav Nadhani FusionCharts Team
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/29/2008 6:11:31 PM
Posts: 1,
Visits: 1
|
|
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!
|
|
|
|