highcharts / export-csv

Highcharts plugin to export chart data to CSV
http://www.highcharts.com/plugin-registry/single/7/Export-CSV
MIT License
76 stars 94 forks source link

'saveAs' is undefined when saving to excel using filesaver.js #143

Closed vamsikrishna007 closed 6 years ago

vamsikrishna007 commented 6 years ago

Hi, when i am exporting the html table to excel, I am getting an error saying "saveAs is Undefined".

$scope.exportToExcel = function () {
    var blob = new Blob([document.getElementById('exporttable').innerHTML], {
        type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
    });
    saveAs(blob, "Report.xls");
};

error

Can some one please help me out in fixing this error.

TorsteinHonsi commented 6 years ago

Hi, first of all, this plugin is now an integrated part of Highcharts, so issues can be handled there.

Also, saving to Excel is a native functionality, using Chart.downloadXLS(). See http://jsfiddle.net/highcharts/n8qhosLo/.