As you can see in http://jsfiddle.net/9pxurfga/
I have export buttons outside the chart, and I need to download data to CSV and XLS.
With highcharts export default button everything works fine : PNG, JPEG, CSV, XLS.
With my custom button PNG export is OK, but not the others.
I dont know how to use exportChart function for CSV and XLS, it seems to work only with image, but not with data/text format.
$('#button1').click(function () {
var chart = $('#container').highcharts();
chart.exportChartLocal({
type: 'text/csv'
});
});
You could call different function specified in the export-data
module named downloadCSV
and downloadXLS
.
For example (JSFiddle):
// Export TO CSV
$('#button2').click(function () {
var chart = $('#container').highcharts();
chart.downloadCSV();
});
// Export TO XLS
$('#button3').click(function () {
var chart = $('#container').highcharts();
chart.downloadXLS();
});
These functions do not use the export server.
Note that to get the same filename output for all buttons I had to add:
exporting: {
filename: 'chart'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With