JSFiddle - React, Tailwind, and code Playground
Fiddle to showcase the batchExport API method
by FusionCharts
HTML
<script src="https://cdn.fusioncharts.com/fusioncharts/latest/fusioncharts.js"></script>
<script src="https://cdn.fusioncharts.com/fusioncharts/latest/themes/fusioncharts.theme.fusion.js"></script>
<button id="export_charts" onclick='batchExportConfig1();'>
Export Charts
</button>
<br>
<div id="chart-container1" class="mb-10">FusionCharts will render here</div>
<div id="chart-container2" class="mb-10">FusionCharts will render here</div>
<div id="chart-container3" class="mb-10">FusionCharts will render here</div>
<div id="chart-container4" class="mb-10">FusionCharts will render here</div>
CSS
#export_charts {
font-size: 13px;
margin-top: 1%;
cursor: pointer;
padding: 10px;
margin-bottom: 10px;
}
.mb-10 {
margin-bottom: 10px;
}
JavaScript
batchExportConfig1 = function() {
FusionCharts.batchExport({
"charts": [{
"id": "chart-1",
}, {
"id": "chart-2",
}, {
"id": "chart-3",
}, {
"id": "chart-4",
}],
"exportFileName": "batchExport",
"exportFormat": "jpg",
"exportAtClientSide": "1"
})
}
FusionCharts.ready(function() {
var revenueChart = new FusionCharts({
id: 'chart-1',
type: 'column2d',
renderAt: 'chart-container1',
width: '450',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Sales report of Apple products",
"subcaption": "2015",
"chartTopMargin": "5",
"subCaptionFontBold": "1",
"rotatevalues": "0",
"numberprefix": "$",
"numbersuffix": "B",
"yAxisMaxValue": "250",
"plotToolText": "<div>Revenue : <b>$datavalue</b></div>",
"theme": "fusion"
},
"data": [{
"label": "iPhone",
"value": "231.22"
}, {
"label": "iPad",
"value": "54.85"
}, {
"label": "iPod",
"value": "20.38"
}]
}
}).render();
var revenueChart = new FusionCharts({
id: 'chart-2',
type: 'column2d',
renderAt: 'chart-container2',
width: '450',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"subcaption": "2014",
"chartTopMargin": "2",
"subCaptionFontBold": "1",
"rotatevalues": "0",
"numberprefix": "$",
"numbersuffix": "B",
"yAxisMaxValue": "250",
"plotToolText": "<div>Revenue : <b>$datavalue</b></div>",
"theme": "fusion"
},
"data": [{
"label": "iPhone",
"value": "169.22"
}, {
"label": "iPad",
"value": "67.99"
}, {
"label": "iPod",
"value": "26.38"
}]
}
}).render();
var revenueChart3D = new FusionCharts({
id: 'chart-3',
type: 'column2d',
renderAt:...