score:7

Accepted answer

You can change the filename of the file. Here is an example on how to accomplish that. The relevant code:

exportButton: {
    menuItems: null,
    onclick: function() {
        chart.exportChart({filename: 'my-png'}, null);
    }
},

Here is another example that shows a little more on what can be controlled during export and printing. The relevant code:

$('#buttonExport').click(function() {
    var e = document.getElementById("ExportOption");
    var ExportAs = e.options[e.selectedIndex].value;   

    if(ExportAs == 'PNG')
    {
        chart.exportChart({type: 'image/png', filename: 'my-png'}, {subtitle: {text:''}});
    }
    if(ExportAs == 'JPEG')
    {
        chart.exportChart({type: 'image/jpeg', filename: 'my-jpg'}, {subtitle: {text:''}});
    }
    if(ExportAs == 'PDF')
    {
        chart.exportChart({type: 'application/pdf', filename: 'my-pdf'}, {subtitle: {text:''}});
    }
    if(ExportAs == 'SVG')
    {
        chart.exportChart({type: 'image/svg+xml', filename: 'my-svg'}, {subtitle: {text:''}});
    }
}); 

$('#buttonPrint').click(function() {
    chart.setTitle(null, { text: ' ' });
    chart.print();
    chart.setTitle(null, { text: 'Click and drag in the plot area to zoom in' });
});

score:2

Can you try this instead

exportButton:{
            menuItems: null,
            onclick:function(){
                var fileName = "AAAA";//it's dynamic in reality.                                    
                this.exportChart({filename : fileName});
             }
         }

exportChart method takes options parameter too..


Related Query

More Query from same tag