DevExtreme v23.1 is now available.
Explore our newest features/capabilities and share your thoughts with us.
You can use two approaches to print and export the Chart: call methods, or add a built-in button with drop-down options. The supported export formats are PNG, PDF, JPEG, SVG, and GIF.
Use the exportTo(fileName, format) and print() methods to export and print the Chart. In this demo, two buttons below the chart implement the print and export functionality. A click on the "Print" button calls the Print dialog window, and a click on the "Export" button saves a file with the component to your local storage. You can specify the file name and format in the exportTo(fileName, format) method.
To automatically create a button with export and print options, use the export object and set its enabled property to true. If you want to disable printing, set the printingEnabled property to false.
Set the formats property to specify an array of available export formats. The fileName property allows you to specify the name of the exported file.
You can see how this approach works in the following demo: JSON Data.
Use the following events to handle export:
onExporting
Occurs before the Chart export.
onExported
Occurs after the Chart export.