1

I'm using below code to export high chart as image, wanted to save in a particular location? can you please help to store autmatically in custom location: ex: D:/wamp/project/images/

$('#buttonExport').click(function() {
        var e = document.getElementById("ExportOption");
        var ExportAs = e.options[e.selectedIndex].value;   
        chart.exportChart({type: 'image/jpeg', filename: 'page1'}, {subtitle: {text:''}});
    });
thirupathi
  • 47
  • 10
  • 1
    According to these answers https://stackoverflow.com/questions/27657117/save-highchart-directly-to-specific-path that is not possible unless you have your own exporting server. – ewolden Aug 07 '17 at 07:40
  • Ooops....thanks for reply...but need to find alternative other than that solution... – thirupathi Aug 07 '17 at 07:49
  • @ewolden, Is there any working examples to create a pdf file with charts(bar, stocked) and mysql data as tables? – thirupathi Aug 07 '17 at 07:52
  • @thirupathi Yes, take a look at the demo where chart is exported along with data table: http://jsfiddle.net/highcharts/z9zXM/. You could also use html2canvas solution (this topic should be helpful: https://stackoverflow.com/questions/45281397/convert-html-with-highcharts-graph-to-image-using-html2canvas/45443746#45443746). – pawel_d Aug 08 '17 at 11:26

1 Answers1

0

Here is a really good summary about how to save a Highchart chart.

An alternative workaround could be call Chart.getSVG() function using javascript on the client and send it to the server via ajax.

var svg = chart.getSVG();

$.post({
    url: 'server.com/upload',
    data: {
        svg: svg
    }
});

And in your server save it anywhere you want.

granch
  • 225
  • 3
  • 12