abdfahim Report post Posted July 28, 2014 (edited) Hi, How to use variables as params in core JS function for rendering chart? FusionCharts.ready(function () { var myChart = new FusionCharts({ "type": "zoomline", "renderAt": "mydivid", "width": "600", "height": "400", "dataFormat": "xml", "dataSource": "xml_code" }); myChart.render(); }); I want to use JS variable divid and strxml as "renderAt" and "dataSource" respectively. Some thing like below var myblocks = document.getElementsByName("alldivs"); var myxml = "XML OUTPUT FROM AJAX REQUEST"; FusionCharts.ready(function () { var myChart = new FusionCharts({ "type": "zoomline", "renderAt": myblocks[0].id, "width": "600", "height": "400", "dataFormat": "xml", "dataSource": myxml }); myChart.render(); }); Edited July 28, 2014 by abdfahim Share this post Link to post Share on other sites
Swarnam Report post Posted July 28, 2014 Hi, Yes, you can pass JS variable to FusionCharts constructor as you've mentioned in the post. Share this post Link to post Share on other sites