Dowload image automatically

Download image automatically without using any click

by Nabajeet Sonowal

HTML

<script src="http://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.widgets.js"></script>
<script src="http://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js"></script>
<div id="chart-container">FusionCharts will render here</div>

JavaScript

FusionCharts.ready(function () {
    var cSatScoreChart = new FusionCharts({
        type: 'angulargauge',
        renderAt: 'chart-container',
        width: '400',
        height: '250',
        dataFormat: 'json',
        dataSource: {
            "chart": {
                "caption": "Customer Satisfaction Score",
                    "subcaption": "Last week",
                    "lowerLimit": "0",
                    "upperLimit": "100",
                    "gaugeFillMix": "{dark-30},{light-60},{dark-10}",
                    "gaugeFillRatio": "15",
                    "theme": "fint",
                    "exportEnabled": "1"
            },
                "colorRange": {
                "color": [{
                    "minValue": "0",
                        "maxValue": "50",
                        "code": "#e44a00"
                }, {
                    "minValue": "50",
                        "maxValue": "75",
                        "code": "#f8bd19"
                }, {
                    "minValue": "75",
                        "maxValue": "100",
                        "code": "#6baa01"
                }]
            },
                "dials": {
                "dial": [{
                    "value": "67"
                }]
            }
        }
    }).render();
    FusionCharts.addEventListener('rendered', function(e, a) {
		if (e && e.sender && e.sender.exportChart) {
			setTimeout(function() {
				e.sender.exportChart({
					exportFormat : "png"
				})
			}, 5000);
		}
	});
});