Custom export output handler

HTML

<script type="text/javascript" src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script type="text/javascript" src="http://www.amcharts.com/lib/3/exporting/amexport_combined.js"></script>
<script type="text/javascript" src="http://www.amcharts.com/lib/3/pie.js"></script>
<script type="text/javascript" src="http://www.amcharts.com/lib/3/themes/none.js"></script>
<div id="chartdiv"></div>

CSS

#chartdiv {
    width : 100%;
    height : 500px;
    font-size : 11px;
}

JavaScript

var chart = AmCharts.makeChart("chartdiv", {
    "type": "pie",
        "theme": "none",
        "dataProvider": [{
        "country": "Lithuania",
            "litres": 501.9
    }, {
        "country": "Czech Republic",
            "litres": 301.9
    }, {
        "country": "Ireland",
            "litres": 201.1
    }, {
        "country": "Germany",
            "litres": 165.8
    }, {
        "country": "Australia",
            "litres": 139.9
    }, {
        "country": "Austria",
            "litres": 128.3
    }, {
        "country": "UK",
            "litres": 99
    }, {
        "country": "كيف علمت بـموكايا",
            "litres": 60
    }, {
        "country": "The Netherlands",
            "litres": 50
    }],
        "valueField": "litres",
        "titleField": "country",
        "exportConfig": {
            menuTop: '30px', // to get rid of the "result" pane
        menuItems: [{
            icon: '//cdn.amcharts.com/lib/3/images/export.png',
            format: 'jpg',
            output: 'datastring',

            onclick: function (exportInstance,exportConfig,event) {
                exportInstance.output(exportConfig,function(blob) {
                    // Custom output callback to work with the imagery
                    // blob contains in this case a base64 jpeg datastring as requested
                });
            }
        }]
    }
});