friction Report post Posted March 11, 2010 Hello all, I would like to know how to batch export charts in server side with one click of the button. Thanks for all the help:) Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted March 11, 2010 Hi, Welcome to FusionCharts forum. I am afraid, as of now, FusionCharts does not support the "Batch Export" functionality on server-side. You need to call server side export for all charts individually. So, each chart gets exported to its own single individual file. Share this post Link to post Share on other sites
friction Report post Posted March 11, 2010 Forgive me if my question seems repeating but is it possible to export multiple charts in server side to their own single individual save file with one click of the button? Share this post Link to post Share on other sites
srividya_sharma Report post Posted March 11, 2010 Yes that is possible. You can export multiple charts to their individual image files with one button click. Call a javascript function on the click of the button, which would initiate export of multiple charts. <script type="text/javascript"> function ExportMyCharts() { var chartObject1 = getChartFromId('myChart1'); if( chartObject1.hasRendered() ) chartObject1.exportChart(); // export another chart var chartObject2 = getChartFromId('myChart2'); if( chartObject2.hasRendered() ) chartObject2.exportChart(); } </script> Hope this helps. Srividya Share this post Link to post Share on other sites
friction Report post Posted March 12, 2010 Thank you for the reply. It does help a little. However, my chart Ids are dynamic and random. Can you show me how to put it into the getChartFromId? thank you Share this post Link to post Share on other sites
srividya_sharma Report post Posted March 12, 2010 Can you show me the piece of code where they are dynamically generated? Waiting for you reply. Share this post Link to post Share on other sites
friction Report post Posted March 12, 2010 (edited) Thank you for replying so fast. The snippets are: Random rdWidget = new Random(); int intWidgetId = rdWidget.nextInt(1000) + 1; String rwId = Integer.toString(intWidgetId); ... [jsp:include page="../include/FusionChartsRenderer.jsp" flush="true" ] [ jsp:param name="chartSWF" value="../charts/Column3D.swf" / ] [ jsp:param name="strURL" value="" / ] [ jsp:param name="strXML" value="<%=strXML%>" / ] [ jsp:param name="chartId" value="<%=rwId%>" / ] [ jsp:param name="chartWidth" value="600" /] [ jsp:param name="chartHeight" value="500" / ] [ jsp:param name="debugMode" value="false" / ] [ jsp:param name="registerWithJS" value="true" / ] [/jsp:include] i would appreciate it if you would show me how to initiate export to save folder of the charts. Thank you in advance. Edited March 12, 2010 by Guest Share this post Link to post Share on other sites
srividya_sharma Report post Posted March 12, 2010 Hi Just after embedding all the charts as you showed in the your previous post, you can put the javascript code <script type="text/javascript"> function ExportMyCharts() { var chartObject1 = getChartFromId('<%=rwId%>'); if( chartObject1.hasRendered() ) chartObject1.exportChart(); // export another chart var chartObject2 = getChartFromId('<%=rwId2%>'); if( chartObject2.hasRendered() ) chartObject2.exportChart(); } </script> I hope the number of charts being shown is static. Hope this helps. Srividya Share this post Link to post Share on other sites
friction Report post Posted March 14, 2010 (edited) Hello, i have tried the method before but it is not working and the number of charts being shown is dynamic. Thank you. Edited March 14, 2010 by Guest Share this post Link to post Share on other sites
srividya_sharma Report post Posted March 15, 2010 Hi Please notice that I have changed the function to use the dynamic id: <%=rwId%> Please do similarly. Hope this helps. Srividya Share this post Link to post Share on other sites
friction Report post Posted March 15, 2010 Hello, I am sorry that i have not replied accurately. What i meant to say is that i have problem with the number of charts image i would like to save to the server because the number of charts to be saved at one time with one click varies and not static all the time. Thank you. Share this post Link to post Share on other sites
srividya_sharma Report post Posted March 15, 2010 Hi You could store the chartIds in a javascript array and then go through each array element, get the chartObject corresponding to it and export that chart. Hope this helps. Srividya Share this post Link to post Share on other sites
friction Report post Posted March 15, 2010 Forgive me if this sounds stupid..but is this what you mean?? script type="text/javascript" function ExportMyCharts() { var chartObject1 = new Array(); var i=0; for(i=1; i<=chartObject1.length; i++) { chartObject1 = getChartFromId('<%=rwId%>'); if( chartObject1.hasRendered() ) {chartObject1.exportChart({exportFormat:'PNG'});} } } /script Share this post Link to post Share on other sites
srividya_sharma Report post Posted March 15, 2010 (edited) Hi How about this? <script type="text/javascript"> var chartIds = new Array("<%=rwId1%>","<%=rwId2%>","<%=rwId3%>"); // or you can create the array dynamically, if required. function ExportMyCharts() { var i=0; for(i=0; i<chartIds.length; i++) { chartObject = getChartFromId(chartIds[i]<%=rwId%>); if( chartObject.hasRendered() ) {chartObject.exportChart({exportFormat:'PNG'});} } } </script > In the above code, I just stored the chartIds in an array. Srividya Edited March 15, 2010 by Guest Share this post Link to post Share on other sites
confused_man Report post Posted March 30, 2010 Can you show an example on how to create the chartIds dynamically? Share this post Link to post Share on other sites
srividya_sharma Report post Posted March 30, 2010 :)Hi Give me some time, I will try to come up with a small example. Thanks for your patience. Srividya Share this post Link to post Share on other sites
confused_man Report post Posted April 21, 2010 Hello..i was wondering if the example is finished...Really looking forward to it..thanks:) Share this post Link to post Share on other sites
srividya_sharma Report post Posted April 22, 2010 Hi I am sorry that I left you confused all these days. Thanks for the reminder. Here is the promised sample. Please replace myDynamicCount to a suitable integer value, in the code. Please replace all the paths used in the file with correct paths as per your directory structure. ( path to the javascript, path to the swf, path to FusionChartsRenderer.jsp ) Hope this helps! Srividya DynamicChartsExportExample.zip Share this post Link to post Share on other sites
patd Report post Posted August 27, 2010 Hello, I have 4 charts on a page that I want to merge together "batch" as a PDF and save on the server with one click of a button. Can you please help me with that using PHP? thank you for your time. pat Share this post Link to post Share on other sites
imurpal Report post Posted May 30, 2015 :)Hi Give me some time, I will try to come up with a small example. Thanks for your patience. Srividya will be more appreciated , if you could share us the sample application file, thanks in advance Share this post Link to post Share on other sites
Swarnam Report post Posted June 1, 2015 Hi, This feature was supported while rendering Flash charts and it has been deprecated. Batch exporting of charts are not supported in JavaScript mode. Share this post Link to post Share on other sites