lfvo Report post Posted June 27, 2012 (edited) Hi, i have a page that contains a DragNode, but i cant get the XML Data, is always give mt error. Heres my HTML code -> http://pastebin.com/1x42qvKk Here is the javascript code -> http://pastebin.com/B5KwwgZw The graphic is drawing ok, but when i click in the savebutton (to get the xml code) gives me a error This is the javascript code i used to get the xml function getInfo(graphId, txtId){ //var ourChart = FusionCharts(graphId); var ourChart = FusionCharts.items[ ""+graphId+"" ]; var xmlRtn = ourChart.getXMLData(); //alert(xmlRtn); document.getElementById(txtId).value = xmlRtn; } Edited June 27, 2012 by lfvo Share this post Link to post Share on other sites
Guest Sumedh Report post Posted June 27, 2012 Hi, i have a page that contains a DragNode, but i cant get the XML Data, is always give mt error. Heres my HTML code -> http://pastebin.com/1x42qvKk Here is the javascript code -> http://pastebin.com/B5KwwgZw The graphic is drawing ok, but when i click in the savebutton (to get the xml code) gives me a error This is the javascript code i used to get the xml function getInfo(graphId, txtId){ //var ourChart = FusionCharts(graphId); var ourChart = FusionCharts.items[ ""+graphId+"" ]; var xmlRtn = ourChart.getXMLData(); //alert(xmlRtn); document.getElementById(txtId).value = xmlRtn; } Hi, Please find attached illustration for your reference. DragNode_getXMLData.zip Share this post Link to post Share on other sites
lfvo Report post Posted June 27, 2012 Hi, i have the same code in other page and its working with the same code, but in that page dont work, always in the same line: var ourChart = FusionCharts.items[ ""+graphId+"" ]; Can't find the object. Hi, Please find attached illustration for your reference. Share this post Link to post Share on other sites
Guest Sumedh Report post Posted June 27, 2012 Hi, Could you please try using following code? Also, it is recommended to use JavaScript rendering method to plot the charts (not to use HTML-Embedded method). <html> <head> <title>Drag Node Chart</title> <script type="text/javascript" src="FusionCharts.js"></script> <script type="text/javascript"> function getXML(){ var myXML=FusionCharts.items["myChartId"]; alert(myXML.getXMLData()); } </script> </head> <body> <div id="chartContainer">Chart Will Load Here</div> <script type="text/javascript"> //FusionCharts.setCurrentRenderer("javascript"); var myChart=new FusionCharts("DragNode.swf","myChartId","600","500","0","1"); myChart.setXMLUrl("DragNodeData.xml"); myChart.render("chartContainer"); </script> <input type="button" value="Get Chart XML" onclick="getXML()"/> </body> </html> Share this post Link to post Share on other sites
lfvo Report post Posted June 27, 2012 (edited) Hi, i saw the code, thats why i said that i have in one page working and the code its the same and dont work in the other page. The implementation is the same like in your example. <script type="text/javascript"> var chart = new FusionCharts("/ChartsRelationShip/Charts/DragNode.swf","'"+ ChartDiv.Id +"ChartId'", "'"+1000 +"'", "'"+1000 +"'"); chart.setDataXML("'" +EncodeJavaScript( DataXML) + "'"); chart.render("'" +ChartDiv.Id +"'"); </script>" Regards, Luis Hi, Could you please try using following code? Also, it is recommended to use JavaScript rendering method to plot the charts (not to use HTML-Embedded method). <html> <head> <title>Drag Node Chart</title> <script type="text/javascript" src="FusionCharts.js"></script> <script type="text/javascript"> function getXML(){ var myXML=FusionCharts.items["myChartId"]; alert(myXML.getXMLData()); } </script> </head> <body> <div id="chartContainer">Chart Will Load Here</div> <script type="text/javascript"> //FusionCharts.setCurrentRenderer("javascript"); var myChart=new FusionCharts("DragNode.swf","myChartId","600","500","0","1"); myChart.setXMLUrl("DragNodeData.xml"); myChart.render("chartContainer"); </script> <input type="button" value="Get Chart XML" onclick="getXML()"/> </body> </html> Edited June 27, 2012 by lfvo Share this post Link to post Share on other sites
Guest Sumedh Report post Posted June 27, 2012 Hi, i saw the code, thats why i said that i have in one page working and the code its the same and dont work in the other page. The implementation is the same like in your example. <script type="text/javascript"> var chart = new FusionCharts("/ChartsRelationShip/Charts/DragNode.swf","'"+ ChartDiv.Id +"ChartId'", "'"+1000 +"'", "'"+1000 +"'"); chart.setDataXML("'" +EncodeJavaScript( DataXML) + "'"); chart.render("'" +ChartDiv.Id +"'"); </script>" Regards, Luis Hi, Are you trying to post chart XML/JSON (data) in other page? Share this post Link to post Share on other sites
lfvo Report post Posted June 27, 2012 Hi, the XML is generated in each page load. The only diference between the pages, is that one page have tabs (and the graphic is in one tab) and the other dont have tabs. (without tabs works) then I think because of the tabs, it can't access to the object (graphic). Hi, Are you trying to post chart XML/JSON (data) in other page? Share this post Link to post Share on other sites
lfvo Report post Posted June 27, 2012 Did the inpect in Chrome, and i get this [/url] I can get it by getelementbyid, mas in the function fusionchart, gives me error. i dont know if this can help Hi, the XML is generated in each page load. The only diference between the pages, is that one page have tabs (and the graphic is in one tab) and the other dont have tabs. (without tabs works) then I think because of the tabs, it can't access to the object (graphic). Share this post Link to post Share on other sites
Guest Sumedh Report post Posted June 28, 2012 Did the inpect in Chrome, and i get this [/url] I can get it by getelementbyid, mas in the function fusionchart, gives me error. i dont know if this can help Hi, Can you please share your entire project here? Share this post Link to post Share on other sites
lfvo Report post Posted June 28, 2012 Hi, No, because its a big project (with several dependencies between them), and built in OutSystems (www.outsystems.com if you dont know what is). its possible the tabs refreshing the javascript and that way dont let me access to that function? Hi, Can you please share your entire project here? Share this post Link to post Share on other sites
lfvo Report post Posted June 28, 2012 Its working now, but i have another program, when i click to save the xml the first time its working, but if i changed the graphic one more time and click on save (getting the xml), the xml its the same saved in the first time, and continues to save the first altered saved xml. What i i've done is moving this code outside the tabs. <script language=""JavaScript""> if(typeof FusionCharts=='undefined') { document.write('<scr'+'ipt language=""JavaScript"" type=""text/javascript"" src=""/ChartsRelationShip/JSClass/FusionCharts.js""><\/scr'+'ipt>'); } </script> Hi, No, because its a big project (with several dependencies between them), and built in OutSystems (www.outsystems.com if you dont know what is). its possible the tabs refreshing the javascript and that way dont let me access to that function? Share this post Link to post Share on other sites
Guest Sumedh Report post Posted June 29, 2012 Hi, Can you paste your XML code? And also send us a screen-shot of the same. Share this post Link to post Share on other sites
lfvo Report post Posted June 29, 2012 Hi Sumedh, Heres an video with the problem, http://screencast.com/t/dLkPsHaf Regards, Luis Hi, Can you paste your XML code? And also send us a screen-shot of the same. Share this post Link to post Share on other sites
Guest Sumedh Report post Posted June 29, 2012 Hi Sumedh, Heres an video with the problem, http://screencast.com/t/dLkPsHaf Regards, Luis Hi, This has been identified as a bug. Our developers are working on this and we will update you on this, as it will be resolved. Share this post Link to post Share on other sites
lfvo Report post Posted June 29, 2012 Thanks Sumedh, Best Regards, Luis Oliveira Hi, This has been identified as a bug. Our developers are working on this and we will update you on this, as it will be resolved. Share this post Link to post Share on other sites
Guest Sumedh Report post Posted June 29, 2012 Thanks Sumedh, Best Regards, Luis Oliveira Thanks for your time and support. Share this post Link to post Share on other sites