Home Forums Chart Support Export chart to excel and edit data in excel to see changes in chart in excel? Reply To: Export chart to excel and edit data in excel to see changes in chart in excel?

#24514

@venkateshganu,

Exporting chart as an image to excel is not available as an inbuilt feature as of now. However, you can use any third party plugin like SheetJS to achieve this functionality. Please check their website for more information. Also, you can check the below code snippet for exporting the chart data in .xlsx format using SheetJS –

function downloadAsExcel(args) {
  var dataPoints, filename;  
  filename = args.filename || 'chart-data';

  dataPoints = args.chart.data[0].dataPoints;
  dataPoints.unshift({x: "X Value", y: "Y-Value"});
  var ws = XLSX.utils.json_to_sheet(dataPoints, {skipHeader:true, dateNF: 'YYYYMMDD HH:mm:ss'});
  if(!ws['!cols']) ws['!cols'] = [];
  ws['!cols'][0] = { wch: 17 };
  var wb = XLSX.utils.book_new();
  XLSX.utils.book_append_sheet(wb, ws, filename);
  XLSX.writeFile(wb, filename + ".xlsx");
}

Kindly check this JSFiddle for a complete working code.

exporting chart data as excel

___________
Indranil Deo
Team CanvasJS