fusion_freak_ Report post Posted September 5, 2012 I have several charts in my application page, where few charts are linked charts. Batch export works fine for these charts, but once i get the linked charts and try to batch export i get error in script. for (var i = 0; i < chartcount; i++) { chartObject1 = getChartFromId('BackLog' + i); if (chartObject1 != null) { if (chartObject1.hasRendered()) //error occurs here when linked charts are viewed and tried for export chartObject1.exportChart(); totalCharts++; } } It would be helpful if a sample code snippet is given to show, how to batch export when linked charts are used. I have another doubt, what will be the chart id of linked chart, is it the parent chart id or should we specify it? Share this post Link to post Share on other sites
FusionCharts Support Report post Posted September 5, 2012 Hi, In case you need to export all the visible charts present in a page irrespective of whether they are linked-child charts or not, you can achieve this using the following code: for (var chartItem in FusionCharts.items) { if (FusionCharts.items[chartItem] && FusionCharts.items[chartItem].isActive() && FusionCharts.items[chartItem].exportChart) { FusionCharts.items[chartItem].exportChart(); } } NOTE: FusionCharts.items returns an Object containing the reference of all the charts (visible or invisible) present in the page. The keys of this object contains the chart IDs. The if expression evaluator first checks whether any object related to that chartID exists Next it checks whether the chart is rendered and visible through - isActive() as it returns false when a chart is hidden. Next it checks if exportChart function is available. IMPORTANT: Each of the charts that you want to export must be configured through XML/JSON to enable export (using exportEnabled, exportHandler and exportAtClient attributes). Share this post Link to post Share on other sites
fusion_freak_ Report post Posted September 6, 2012 Thank you Sudipto Choudhury for your immediate response. This is what i actually wanted. Hi, In case you need to export all the visible charts present in a page irrespective of whether they are linked-child charts or not, you can achieve this using the following code: for (var chartItem in FusionCharts.items) { if (FusionCharts.items[chartItem] && FusionCharts.items[chartItem].isActive() && FusionCharts.items[chartItem].exportChart) { FusionCharts.items[chartItem].exportChart(); } } NOTE: FusionCharts.items returns an Object containing the reference of all the charts (visible or invisible) present in the page. The keys of this object contains the chart IDs. The if expression evaluator first checks whether any object related to that chartID exists Next it checks whether the chart is rendered and visible through - isActive() as it returns false when a chart is hidden. Next it checks if exportChart function is available. IMPORTANT: Each of the charts that you want to export must be configured through XML/JSON to enable export (using exportEnabled, exportHandler and exportAtClient attributes). Share this post Link to post Share on other sites