CanvasJS jQuery Plugin supports Exporting Chart as Image in case you want to save a static copy of chart. Images can be exported to JPEG and PNG formats. Given example shows a Spline Chart with export feature enabled. It also includes source code that you can edit in-browser or save to run locally.
window.onload = function () { //Better to construct options first and then pass it as a parameter var options = { title: { text: "Spline Chart with Export as Image" }, animationEnabled: true, exportEnabled: true, data: [ { type: "spline", //change it to line, area, column, pie, etc dataPoints: [ { x: 10, y: 10 }, { x: 20, y: 12 }, { x: 30, y: 8 }, { x: 40, y: 14 }, { x: 50, y: 6 }, { x: 60, y: 24 }, { x: 70, y: -4 }, { x: 80, y: 10 } ] } ] }; $("#chartContainer").CanvasJSChart(options); }
You can set the name of the image file using exportFileName. You can change the opacity of filled area using fillOpacity. Color of line and filled area can also be changed using lineColor and color.
Note For step by step instructions, follow our jQuery Integration Tutorial