This plugin allows you to export and save CanvasJS Chart's data as CSV. Check out Github Repository for more info / examples.
/* HTML Script Tag */
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/export-canvasjs-chart-data-as-csv/dist/canvasjsascsv.min.js"></script>
/* or */
import CanvasJS from './canvasjs.min';
window.CanvasJS = CanvasJS;
require('export-canvasjs-chart-data-as-csv');
/* React */
import CanvasJSReact from './canvasjs.react';
window.CanvasJS = CanvasJSReact.CanvasJS;
require('export-canvasjs-chart-data-as-csv');
var chart = new CanvasJS.Chart("chartContainer", {
.
.
.
exportEnabled: true,
//Chart Options
.
.
.
});
chart.render();
Example 1: Basic Example
Example 2: Exporting Multi-Series Chart as CSV