renukasagani Report post Posted November 10, 2010 (edited) Hi, I want to save multiple images save to server using fuioncharts 3.2.1 html5 javascript menthod, I am able to render the chart , if I want to export to server side getting error like "chartObject.getSVG is not a function". So can you please an idea to getSVG with chart object in the javascript , I think I have used wrong syntax to getSVg string. Actually I tried to use chartObject.exportChart() function to export images , but unfortunately this is working in firefox, not working in IE, in IE only one image exporting after that I am getting error message like "getElementsBytagName(DIV)[0]" is null, in highcharts. So I am trying to get svgstring of rendered chart using javascript after that I would like to convert into image using server side batik method in php. I have modified FC_export.php file as per server side settings , but for each image giving image download alert box in firefox, it suppose to save image directly in specified directory it is saving also giving download alert , so how to avoid this . Below is my code : <script type="text/javascript" src="http://localhost/test/FusionCharts_3.2.1/Charts/FusionCharts.js"></script> <script type="text/javascript"> function ExportMyCharts() { var chartObject=getChartFromId('myChartId'); var svg=chartObject.getSVG(); alert(svg); var chartObject1=getChartFromId('myChartId1'); var svg1=chartObject1.getSVG(); alert(svg1); } </script> <input name="button" type="button" class="button" value="export" onclick="ExportMyCharts();"/> <div id="chartContainer">FusionCharts will load here!</div> <script type="text/javascript"> FusionCharts.setCurrentRenderer('javascript'); var myChart = new FusionCharts( "http://localhost/test/FusionCharts_3.2.1/Charts/Column2D.swf", "myChartId", "400", "300", "1", "1" ); myChart.setXMLUrl("http://localhost/test/FusionCharts_3.2.1/Code/ExportChartSamples/PureJavaScript/Data.xml"); myChart.render("chartContainer"); myChart._overrideJSChartConfiguration({ exporting:{ url: 'http://localhost/test/export/exporting-server/index.php', //path of HC exporter type: 'image/svg+xml' } }); </script> <div id="chartContainer1">FusionCharts will load here!</div> <script type="text/javascript"> FusionCharts.setCurrentRenderer('javascript'); var myChart = new FusionCharts( "http://localhost/test/FusionCharts_3.2.1/Charts/Column2D.swf", "myChartId1", "400", "300", "1", "1" ); myChart.setXMLUrl("http://localhost/test/FusionCharts_3.2.1/Code/ExportChartSamples/PureJavaScript/Data2.xml"); myChart.render("chartContainer1"); myChart._overrideJSChartConfiguration({ exporting:{ url: 'http://localhost/test/export/exporting-server/index.php', //path of HC exporter type: 'image/svg+xml' } }); </script> please give any suggestions to get SVG string using javascript function, especially in IE these functions are not working properly. Thanks, Renuka Edited November 10, 2010 by renukasagani Share this post Link to post Share on other sites
renukasagani Report post Posted November 12, 2010 Hi, I want to save multiple images save to server using fuioncharts 3.2.1 html5 javascript menthod, I am able to render the chart , if I want to export to server side getting error like "chartObject.getSVG is not a function". So can you please an idea to getSVG with chart object in the javascript , I think I have used wrong syntax to getSVg string. Actually I tried to use chartObject.exportChart() function to export images , but unfortunately this is working in firefox, not working in IE, in IE only one image exporting after that I am getting error message like "getElementsBytagName(DIV)[0]" is null, in highcharts. So I am trying to get svgstring of rendered chart using javascript after that I would like to convert into image using server side batik method in php. I have modified FC_export.php file as per server side settings , but for each image giving image download alert box in firefox, it suppose to save image directly in specified directory it is saving also giving download alert , so how to avoid this . Below is my code : <script type="text/javascript" src="http://localhost/test/FusionCharts_3.2.1/Charts/FusionCharts.js"></script> <script type="text/javascript"> function ExportMyCharts() { var chartObject=getChartFromId('myChartId'); var svg=chartObject.getSVG(); alert(svg); var chartObject1=getChartFromId('myChartId1'); var svg1=chartObject1.getSVG(); alert(svg1); } </script> <input name="button" type="button" class="button" value="export" onclick="ExportMyCharts();"/> <div id="chartContainer">FusionCharts will load here!</div> <script type="text/javascript"> FusionCharts.setCurrentRenderer('javascript'); var myChart = new FusionCharts( "http://localhost/test/FusionCharts_3.2.1/Charts/Column2D.swf", "myChartId", "400", "300", "1", "1" ); myChart.setXMLUrl("http://localhost/test/FusionCharts_3.2.1/Code/ExportChartSamples/PureJavaScript/Data.xml"); myChart.render("chartContainer"); myChart._overrideJSChartConfiguration({ exporting:{ url: 'http://localhost/test/export/exporting-server/index.php', //path of HC exporter type: 'image/svg+xml' } }); </script> <div id="chartContainer1">FusionCharts will load here!</div> <script type="text/javascript"> FusionCharts.setCurrentRenderer('javascript'); var myChart = new FusionCharts( "http://localhost/test/FusionCharts_3.2.1/Charts/Column2D.swf", "myChartId1", "400", "300", "1", "1" ); myChart.setXMLUrl("http://localhost/test/FusionCharts_3.2.1/Code/ExportChartSamples/PureJavaScript/Data2.xml"); myChart.render("chartContainer1"); myChart._overrideJSChartConfiguration({ exporting:{ url: 'http://localhost/test/export/exporting-server/index.php', //path of HC exporter type: 'image/svg+xml' } }); </script> please give any suggestions to get SVG string using javascript function, especially in IE these functions are not working properly. Thanks, Renuka Hi, I am able to get svg after modifying highchart .js and fusionchart js files, now I am able to get svg of renderchart. Regards, Renuka Share this post Link to post Share on other sites
Sanjukta Report post Posted November 19, 2010 Hi Renuka, Glad that your issue is resolved. Please feel free to revert in case you have any further queries. Share this post Link to post Share on other sites
karthik_k2 Report post Posted December 20, 2011 Hi, I just started using fusion charts in my application. I am using Fusion Charts Enterprise Version v3.2. The application i use is purely javascript coded. My intention was to get the svg string of the charts and i used FusionCharts('chartId').ref.FCC.getSVG() for that. It works fine for all the charts except multi-series line(MSLine). Is there any other way by which i can generate the svg string? And yeah I am fetching the data from the database . Since for every other charts the code hoplds good, i dont think this would be the problem. Please help m solve this issue. Thanks in advance. Share this post Link to post Share on other sites
Guest Angshu Report post Posted December 20, 2011 Hi, Welcome to FusionCharts Forum! Could you please download the latest version of FusionCharts i.e FusionCharts XT (v 3.2.2) from : http://www.fusioncharts.com/download/trials/ and see if this helps? All the features of FusionCharts XT (v3.2.2) are backward compatible with FusionCharts v3.1. Hence, upgrading is as easy as copy-pasting files. More details at : http://docs.fusioncharts.com/charts/?Introduction/Upgrading32.html Looking forward to your response. Share this post Link to post Share on other sites
karthik_k2 Report post Posted December 28, 2011 Hi, Welcome to FusionCharts Forum! Could you please download the latest version of FusionCharts i.e FusionCharts XT (v 3.2.2) from : http://www.fusioncha...ownload/trials/ and see if this helps? All the features of FusionCharts XT (v3.2.2) are backward compatible with FusionCharts v3.1. Hence, upgrading is as easy as copy-pasting files. More details at : http://docs.fusionch...pgrading32.html Looking forward to your response. I have downloaded the latest version(v 3.2.2) and upgraded my application. But now it shows FusionCharts('ChartId') is undefined. I used the code FusionCharts('ChartId').ref.FCC.getSVG(); Do I have to change something? Share this post Link to post Share on other sites
karthik_k2 Report post Posted January 3, 2012 I have downloaded the latest version(v 3.2.2) and upgraded my application. But now it shows FusionCharts('ChartId') is undefined. I used the code FusionCharts('ChartId').ref.FCC.getSVG(); Do I have to change something? Apologies for the mistake. The error was " FusionCharts('ChartId').ref is undefined". Looking fir the directions... Share this post Link to post Share on other sites
Sanjukta Report post Posted March 28, 2012 Hi, Could you please try using the following code to generate SVG string? FusionCharts("myChartId").ref.getSVGString() Hope this helps. Share this post Link to post Share on other sites
ashakoshti Report post Posted May 29, 2012 hi.. In my JSP PAge i tried below two types..but still it is showing undefined error.. alert(FusionCharts('ChartId').ref.FCC.getSVG()); alert(FusionCharts("ChartId").ref.getSVGString()); Hi, Could you please try using the following code to generate SVG string? FusionCharts("myChartId").ref.getSVGString() Hope this helps. Share this post Link to post Share on other sites
ashakoshti Report post Posted May 29, 2012 Hi, can you please tel me what changes have you done..because I am also facing the same problem.. Hi, I am able to get svg after modifying highchart .js and fusionchart js files, now I am able to get svg of renderchart. Regards, Renuka Share this post Link to post Share on other sites
Sanjukta Report post Posted June 5, 2012 Hi Asha, We have reported the issue you have raised and our Engineering team is currently looking into this. However, we are currently working on some other issues at the same time, including version upgrades to some of the other products in the FusionCharts Suite and as such, this particular issue will take some time to address. This issue has also been highlighted by some other users and please be rest assured that we are going to address this shortly. With regards to timeframes, we are hopeful of providing a work-around solution to this issue within a month's time or so. Thank you for your continued support. Share this post Link to post Share on other sites