Loko Report post Posted May 7, 2009 (edited) Hello I'm a new user to FusionCharts, and trying to adapt the samples to my needs. This is my HTML/JS code : var chart = new FusionCharts("../Charts/MSLine.swf", "ChartId", "600", "350", "0", "1"); chart.setDataURL('/portal/pls/portal/gfc_dev.deplacements.p_test?'); chart.render("chartdiv"); and my server returns : --> see attachement as the [ code ] [ /code] tags does not seem to work. And I get the "Error in loading data" message. It works fine if I put the data in a javascript variable and pass it to setDataXML(). Could you explain me what's wrong ? Regards Loko data.txt Edited May 7, 2009 by Guest Share this post Link to post Share on other sites
Dhruva Report post Posted May 7, 2009 Hello Loko, Welcome to the forum. In the line--> chart.setDataURL('/portal/pls/portal/gfc_dev.deplacements.p_test?'); The path needs to be set to the XML file. Could you please rectify this and try again? Share this post Link to post Share on other sites
Loko Report post Posted May 7, 2009 (edited) There is no xml file. This url launches a script on the server that then returns the content of my attached file as en HTTP response. Many data servers work like this, to return some XML or JSON data on the fly, without having to manage some boring and useless files. Edited May 7, 2009 by Guest Share this post Link to post Share on other sites
Dhruva Report post Posted May 7, 2009 Okay. Could you please ensure that the script sends content=text/xml and try again? Your current script seems to be sending content=text/html . I hope this helps! Share this post Link to post Share on other sites
Loko Report post Posted May 7, 2009 Yes, you're right, I got use to send some JSON data and in that case, text content is ok. I guess this would work with the content=text/xml flag, but unfortunatly I can't set it within my server script :-( Anyway I can workaround this : I will get the xml data via an ajax call then store it in a javascript var then use setDataXML. Many thanks for your help. Share this post Link to post Share on other sites
Dhruva Report post Posted May 9, 2009 You're welcome! Share this post Link to post Share on other sites