mtm81 Report post Posted February 5, 2009 Hi, I have the save image functionality working if I right click the chart (I'm using a gantt widget chart) however I run the saveimage from a button click. therefore I have the following function in the head tag of my page: function saveChart(){ //Get chart from its ID var chartToPrint = getChartFromId("chartdiv"); chartToPrint.saveAsImage(); } I run this from an onclick behaviour on a button my page. the code for rendering the chart is as follows: <div id="chartdiv" align="center">Loading Time Planning . . .</div> <script type="text/javascript"> var myChart = new FusionCharts("Charts/Gantt.swf", "chartdiv", "<%=ChartWidth%>", "500", "0", "1"); myChart.setDataURL("<%=DataUrl%>"); myChart.render("chartdiv"); </script> I have made sure I'm up to date with the latest version of both the charts and the widgets of which I have both... I've also tried editing the "myChart=" line to be: var myChart = new FusionCharts("Charts/Gantt.swf?RegisterwithJS=1", "chartdiv", "<%=ChartWidth%>", "500", "0", "0"); and I still get the same error any ideas? James Share this post Link to post Share on other sites
Rahul Kumar Report post Posted February 5, 2009 (edited) Hi, Please use unique id for DIV and chart. Wrong: <div id="chartdiv" align="center">Loading Time Planning . . .</div> <script type="text/javascript"> var myChart = new FusionCharts("Charts/Gantt.swf", "chartdiv", "<%=ChartWidth%>", "500", "0", "1"); myChart.setDataURL("<%=DataUrl%>"); myChart.render("chartdiv"); </script> It should be: <div id="chartdiv" align="center">Loading Time Planning . . .</div> <script type="text/javascript"> var myChart = new FusionCharts("Charts/Gantt.swf", "chartID", "<%=ChartWidth%>", "500", "0", "1"); myChart.setDataURL("<%=DataUrl%>"); myChart.render("chartdiv"); </script> Also in Script: function saveChart(){ //Get chart from its ID var chartToPrint = getChartFromId("chartID"); chartToPrint.saveAsImage(); } Edited February 5, 2009 by Guest Share this post Link to post Share on other sites