Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Export JavaScript Chart to Excel file (HighCharts)

I have to Export a Javascript chart (HighCharts) into an excel file; the chart was rendered in a div, but the excel doesn't render the html+css content the javascript generates, render only the text without style.

A solution would be convert this where the chart was rendered into an image(jpeg) but I have no success...

Thanks !

like image 944
Rafael Ranzolin Avatar asked Sep 06 '11 19:09

Rafael Ranzolin


1 Answers

HighCharts already supports the image exporting functionality via the Exporting Module which is packaged with it. Exporting After getting it you should be able to modify the script to save the image in any way you need. It's certainly not a beginners task and will require lots of tinkering.

If it were me I would modify the code that responds to the export button so that I can activate it with JavaScript and also pass in information so that the PHP file on the back-end could save the picture in the manner you want rather than returning it to the client.

like image 100
Gunnar Hoffman Avatar answered Oct 26 '22 12:10

Gunnar Hoffman