cheesegrits Report post Posted January 18, 2010 I've googled till I'm blue in the face, read this forum from cover to cover, but like a lot of folk I'm having an issue trying to get setDataXML to work. Here's the relevant chunks of my code: var chartObj; function calculateLoan_RateMargin() { ... blah ... new Ajax(url, { data: { ... blah ... onComplete: function(response){ $('calculating_loan').hide(); if (response != '') { json = Json.evaluate(response); if (json['errors'] != '') { alert("Error: " + json['errors']); } else { ... blah... //var chartObj = getChartFromId("Pie2D1"); chartObj.setDataXML(json['chart']); } } } }).request(); } window.addEvent('domready', function(){ var chart_Pie2D1 = new FusionCharts("components/com_fabrik/plugins/visualization/fusionchart/FCcharts/FCF_Pie2D.swf","Pie2D1", "300", "300", "0", "1", "","noScale","EN"); chartObj = chart_Pie2D1; //Provide entire XML data using dataXML method chart_Pie2D1.setDataXML(""); chart_Pie2D1.render("Pie2D1Div"); }); My Pie2D1Div is not inside a form. I'm setting RegisterWithJS. The AJAX call returns correct XML. But no matter what I try, when I call setDataXML, these two lines: var chartObj = infosoftglobal.FusionChartsUtil.getChartObject(this.getAttribute('id')); chartObj.setDataXML(strDataXML ... inside your setDataXML always return a chartObj which is the embed element, not the actual chart object, so the call fails because the setDataXML method doesn't exist. As you can see from my code, I've tried the getChartFromId method, and copying the original object to my own variable. I'm beating my brains out on this one, any help much appreciated. -- hugh Share this post Link to post Share on other sites
cheesegrits Report post Posted January 18, 2010 (edited) Just FYI, the initial call to setDataXML (inside the domReady function) does have valid XML data, it just got removed when posting, presumably phpBB not liking the chevron tags. Also, just in case it is relevant, I'm using Mootools 1.2, which is where the domReady event and the Ajax call are handled. And ... the initial chart render in the domReady works like a charm. -- hugh Edited January 18, 2010 by Guest Share this post Link to post Share on other sites
cheesegrits Report post Posted January 18, 2010 OK, I just found some other responses to this issue explaining that the setDataXML() method is not exposed to JS in the free version. Don't know how I missed that on my first pass through this forum, I must be going blind. So I'm working round it by just re-rendering the chart after each AJAX call. Works fine. Thanks for an awesome product! -- hugh Share this post Link to post Share on other sites
Guest Madhumita Report post Posted January 18, 2010 Hello, In free version the updateChartXML() method is used to update the data of the chart. ref. - http://www.fusioncharts.com/free/docs/Contents/JS_setDataXML.html Thanks a lot for appreciating our product. Share this post Link to post Share on other sites
cheesegrits Report post Posted January 19, 2010 Ah HAH! Thanks for the quick response. I'll try that. Re-rendering is working OK, but would obviously be cleaner to just update it. -- hugh Share this post Link to post Share on other sites
Guest Rajroop Report post Posted January 19, 2010 Hi Hugh, You are most welcome! Glad to have shown you the way. Now, you must walk towards that direction! Share this post Link to post Share on other sites