dharmendra Report post Posted March 6, 2008 I am tring to to save the chart as an image .I also included the FusionCharts.js properly. even though it is throwing javascript error like chartToPrint.saveAsImage() function is not defined. I am using fusion chart 2.0.5 version.I searched saveAsImage() function in FusionCharts.js .It was not present there. Anyone can provide me the FusionCharts.js which includes saveAsImage () function Or any other solution . Thanks in advance Share this post Link to post Share on other sites
Pallav Report post Posted March 6, 2008 You need to use v3.0.6 Share this post Link to post Share on other sites
dharmendra Report post Posted March 7, 2008 Hi, Can you please provide the me the code of saveAsImage() function of FusionCharts.js which is updated in v3.0.6? I will be very thankful to you. Thanks Share this post Link to post Share on other sites
FusionCharts Support Report post Posted March 7, 2008 hi, You would need the swf of v3.0.6. The javascript file remains the same. Please read this page in our documentaion for more info: http://www.fusioncharts.com/docs/Contents/JS_saveAsImage.html Share this post Link to post Share on other sites
dharmendra Report post Posted March 10, 2008 Hi , Actually, i am using the evaluation version of v3 which is presently available at your site . And I also used the same information as you provided the link for saveAsImage function . I copy the whole example as it is mentioned in the link. It fails at the line chartToPrint.saveAsImage();and gives the error 'chartToPrint.saveAsImage() is not a function' in error console.So, I just want to confirm that this facility (save as image ) is available in evaluation version or not. If not ,then how can i achieve this facility.Please provide me exact solution. Thanks Share this post Link to post Share on other sites
FusionCharts Support Report post Posted March 11, 2008 Hi, No single feature is disabled in eval version. There might be som other issues. Also please check if you are running the application from a server. Or you might need to set up Flash Player security options online from Adobe's website. Share this post Link to post Share on other sites
dharmendra Report post Posted March 11, 2008 (edited) Hi Sudipto, I have Adobe flash version 9.I am running the same on server. Even though it is not working . Can you please tell me saveAsImage function should be present in FusionCharts.js or not. If yes ,then it is not available in evaluation version. I am also attached the code.Please look into this . function saveChart(){ //Get chart from its ID var chartToPrint = getChartFromId("chart1Id"); chartToPrint.saveAsImage(); } and var chart1 = new FusionCharts("../FusionCharts/Column3D.swf", "chart1Id", "400", "300", "0", "1"); chart1.setDataXML(""); chart1.render("chart1div"); and the data.xml is chart imageSave='1' imageSaveURL='http://localhost:8080/jsp-examples/FusionCharts/MyFirstChart/ImageSaving/FusionChartsSave.jsp'> Everything is in the path.Please look into this. Thanks Edited March 11, 2008 by Guest Share this post Link to post Share on other sites
FusionCharts Support Report post Posted March 12, 2008 Hi, There are some functions in FusionCharts which are exposed and can be accessed from the chart itself. Flash techies call this externalInterface functions. We can use JavaScript to call these functions directly. saveAsImage() is one of these functions. Hence, you would not get this entry in FusionCharts.js. But, if you use FusionCharts SWFs whose version is v3.0.6 you would definitely get this featute. Could you please check whether you have the specified version of chart SWF files. To know your version to this precision 3.x.x, please render a chart with debug mode on. In the debug window you would get the version info. Share this post Link to post Share on other sites
dharmendra Report post Posted March 12, 2008 Hi Sudipto, You are right .Actually i looked into the version of swf files it was of version 3.0.3 .I copied the latest swf files .It is working fine now. I have one question. I would like to know the link where all methods are given like FC_render etc.Can you please provide me. Thanks a lot. Share this post Link to post Share on other sites
karenw Report post Posted April 1, 2008 I am having the same error and I do have v.3.0.6 and have wasted nearly a whole day on this.:w00t: Share this post Link to post Share on other sites
FusionCharts Support Report post Posted April 2, 2008 Hi karenw, Could you please send us the code that you are using? and also specify which technology you are using, like ASP/PHP/.NEt etc. Please also make sure to let the chart finish rendering (can be tracked using FC_Rendered() function) before you call save as image JS API. karenw Share this post Link to post Share on other sites
hungtrieu2910 Report post Posted December 3, 2008 I had the same problem, but I have corrected it. My problem is I forgot set 'registerWithJS' flag to 1 instead 0. Make sure you specify: var chart1 = new FusionCharts("../../FusionCharts/Column3D.swf", "chart1Id", "400", "300", "0", "1"); not: var chart1 = new FusionCharts("../../FusionCharts/Column3D.swf", "chart1Id", "400", "300", "0", "0"); Please notice different between the last value of two statement above (1 vs 0). When I change the last value from 0 to 1, function saveAsImage() work fine. Share this post Link to post Share on other sites
ephillipe Report post Posted February 6, 2009 I have a same error! Declaration of chart appear correctly: var chart_versusChart = new FusionCharts("/FusionCharts/Pie3D.swf?registerWithJS='1'", "versusChart", "100%", "100%", "0", "1"); chart_versusChart.setDataXML(" Share this post Link to post Share on other sites
Rahul Kumar Report post Posted February 6, 2009 Hi, I am afraid, your declaration of chart is not correct: var chart_versusChart = new FusionCharts("/FusionCharts/Pie3D.swf?registerWithJS='1'", "versusChart", "100%", "100%", "0", "1");chart_versusChart.setDataXML(""); chart_versusChart.render("versusChartDiv"); It should be: var chart_versusChart = new FusionCharts("/FusionCharts/Pie3D.swf?", "versusChart", "100%", "100%", "0", "1");chart_versusChart.setDataXML(""); chart_versusChart.render("versusChartDiv"); Please avoid using ' (quote) or " (double quote) in a query string. And if you are passing 1 to the last parameter then there is no need to passing registerWithJS=1 from query string. Share this post Link to post Share on other sites
ephillipe Report post Posted February 6, 2009 Hi, after changes, function saveAsImage works. But function view2D don't. Error: chartToView2D.view2D is not a function My functions: function viewAs2D() { //Get chart from its ID var chartToView2D = getChartFromId("versusChart"); chartToView2D.view2D(); } function viewAs3D() { //Get chart from its ID var chartToView3D = getChartFromId("versusChart"); chartToView2D.view3D(); } function saveChart() { //Get chart from its ID var chartToPrint = getChartFromId("versusChart"); chartToPrint.saveAsImage(); } JS now: var chart_versusChart = new FusionCharts("/FusionCharts/Pie3D.swf", "versusChart", "100%", "100%", "0", "1"); chart_versusChart.setDataXML(" Share this post Link to post Share on other sites
Rahul Kumar Report post Posted February 6, 2009 Hi, I am afraid, view2D and view3D is not exposed to JavaScript externalInterface, meaning you could not use view2D and view3D. Share this post Link to post Share on other sites
ephillipe Report post Posted February 9, 2009 Hi, Documentation say is possible :doze:: Combination 3D chart exposes a number of functions for better interactivity. These functions can be called using JavaScript. Shown below is a list of these functions along with their description and parameter(s): http://www.fusioncharts.com/Docs/Contents/Combi3D_JSAPI.html Share this post Link to post Share on other sites
Rahul Kumar Report post Posted February 9, 2009 (edited) Hi, I am afraid, the docs you are viewing is for MultiSeries Combination 3D Chart (mscombi3d.swf) and the chart you are using is a (pie3d.swf), please see your code below. var chart_versusChart = new FusionCharts("/FusionCharts/Pie3D.swf", "versusChart", "100%", "100%", "0", "1"); chart_versusChart.setDataXML(""); chart_versusChart.render("versusChartDiv"); Also please note that pie chart does not support this features. Edited February 11, 2009 by Guest Share this post Link to post Share on other sites
ephillipe Report post Posted February 9, 2009 Ok. thanks. Share this post Link to post Share on other sites
vipin jain Report post Posted March 5, 2009 I have a same error! Declaration of chart appear correctly:[p] var myChart = new FusionCharts("D:Program FilesTomcat 5.5webappsFusionCImageSaveWebContentChartsColumn3D.swf", "chart1Id", "400", "200", "0", "1"); myChart.setDataURL("D:Program FilesTomcat 5.5webappsFusionCImageSavedocumentxmlfile.xml"); myChart.render("chart1div"); [/p] My JS functions:[p] var chartToPrint = getChartFromId("chart1Id"); alert(chartToPrint); chartToPrint.saveAsImage(); [/p] Error in button click: chartToPrint.saveAsImage is not a function My SFW version FusionCharts v3, Share this post Link to post Share on other sites
Rahul Kumar Report post Posted March 5, 2009 Hi Vipin, If you are running your HTML locally then by default Flash Player's security setting blocks invoking/calling JavaScript from SWF (Flash Movie), so you need to reset your setting into Global Security Setting panel. Please see the following post for more information: http://www.fusioncharts.com/forum/FindPost8077.aspx Share this post Link to post Share on other sites