1

This jsfiddle shows how to export a Highcharts chart to a png file, however doesn't show how to specify the file name.

Something like

var image = canvas.toDataURL("image/png")
            .replace("image/png", "image/octet-stream"); 

image.filename = "file.png";    <=== this doesn't work

// Save locally
window.location.href = image;

Any ideas?

SteveP
  • 18,840
  • 9
  • 47
  • 60
ps0604
  • 1,227
  • 23
  • 133
  • 330
  • This is the answer posted in SO http://stackoverflow.com/questions/21772424/saving-images-from-html5-canvas-directly – ps0604 Oct 05 '14 at 17:35
  • Have you tried [this solution](http://stackoverflow.com/questions/15811897/how-to-save-a-canvas-with-image-to-a-png-file) ? – Paweł Fus Oct 06 '14 at 12:09

1 Answers1

-1

var image = Canvas.toDataURL("image/png").replace("image/png", "image/octet-stream"); window.location.href=image; // it will save locally

HAri
  • 57
  • 1
  • 10