exportEnabled: Boolean

Setting exportEnabled to true enables the export feature. It allows you to Print (v1.9.5 and above) or Save the Chart as JPEG / PNG formats. Export feature is available in all Chart Types.

Default: false
Options: true, false

Notes
  • Not Supported on IE8-


var  chart =  new  CanvasJS("container",
{
 .
 .
 exportEnabled: true,
 .
 .
});
chart.render();


Try it Yourself by Editing the Code below.



If you have any questions, please feel free to ask in our forums.Ask Question

Comments 28

  1. Pingback: CanvasJS v1.5 with Stock Charts, Range Charts & Export as Image Feature

  2. Is there a method to set the name of the exported chart rather than the default “Chart.jpg” or “Chart.png”?

    • We’ve added a new property “exportFileName” at the top level of options using which you can set exported chart’s name. You can download the internal build from here. Do let us know if it worked as expected.

      • Fantastic! Thank you. …and in reply to your question the answer is yes and no. “Save As” functionality instead of “Save” would be a better solution. As is I’ll have to update exportFileName every time new data is received. Else the user will have to rename the saved file after each save. Either way, again thank you for your excellent work.

      • because i need to create a PDFs file of number of charts . so i want a function that automatically create a PDFs of all charts . i am using asp.net mvc and javascript

  3. As of now Charts can only be saved with the default name. But surely we will implented this feature in V1.5 GA.

  4. This feature is nice, but when using with .net and firefox it was causing a postback. I had to add the following (this._menuButton.setAttribute(“type”,”button”)) so that it would not default to type “submit”.

    • You cannot do this via the CanvasJS API itself. But given that you have the JSON data, you should be able to construct these files in JavaScript and export the same using filesaver.

    • As as now we don’t have a method to export chart – will be implementing in future versions.

      But you can do the same with few lines of code. Here is an example.

  5. Is it possible that when chart created its also auto create image and save on server. So i can view that in future, rather every time call logic for create chart.

  6. Hi Guys,

    Is a chart exportable to excel (not as an image; but as excel chart object) ? This will be a great feature if its already available. Please alert me if its done or if there is any suggestive alternative to achieve this.

    Thank you,
    Pruthvi

    • Pruthvi Kumar,

      You can use libraries like excelbuilder or SheetJS to export as excel. But exporting charts as excel object is not supported but it can be inserted as image in excel file using those libraries.

If you have any questions, please feel free to ask in our forums. Ask Question