Overview
The Exporting plugin enables you to export chart visualizations and data in multiple formats. It supports image exports (PNG, JPG), PDF generation, data exports (CSV, JSON, XLSX, HTML), and printing functionality.Installation
Import the Exporting plugin and related classes from the plugins module:Basic Usage
Adding Exporting to a Chart
Create an Exporting instance and attach it to your root element:Programmatic Export
You can trigger exports programmatically without showing the menu:Export Formats
Image Formats
Export charts as raster images:Image Export Options
Image quality from 0 to 1 (default: 1 for PNG, 0.8 for JPG)
Export with hardware resolution (
false) or screen appearance (true)Minimum width of exported image in pixels
Maximum width of exported image in pixels
Minimum height of exported image in pixels
Maximum height of exported image in pixels
PDF Export
Generate PDF documents with chart images:PDF Options
Image format for embedded chart image
Page size (A0-A10, B0-B10, C0-C10, LETTER, LEGAL, etc.)
Page orientation
Page margins as a number or array
[left, top, right, bottom]Font size for text elements
Chart image alignment in PDF
Include source page URL in the PDF
Data Export
Export chart data in various formats:Data Export Options
Array of data objects to export
Map of field names to column headers:
{ fieldName: "Column Name" }Array specifying the order of fields in export
Fields containing numeric values for proper formatting
Fields containing date values
Date format for date fields
Number format for numeric fields
Configuration
General Settings
Prefix for downloaded file names
Chart title for print, PDF, and Excel exports
Background color for exported images (auto-detected if not set)
Background opacity (0 = transparent, 1 = opaque)
Export Menu
Customize the export menu appearance and behavior:Including Multiple Charts
Export multiple charts in a single image:Events
Listen to export lifecycle events:Available Events
exportstarted
Triggered when export operation begins
exportfinished
Triggered when export operation completes
downloadstarted
Triggered when file download begins
printstarted
Triggered when print operation starts
dataprocessed
Triggered after data is processed for export
pdfdocready
Triggered when PDF document is prepared (can be modified)
workbookready
Triggered when XLSX workbook is prepared (can be modified)
Advanced Usage
Custom Print Options
PDF with Data Table
Export PDF with both chart image and data table:Canvas Export
Get a canvas element for custom processing:Browser Compatibility
The Exporting plugin works in all modern browsers. Note that:- PDF export requires the pdfmake library (loaded automatically)
- XLSX export requires the xlsx library (loaded automatically)
- Some browsers may prompt for download permission
Performance Tips
See Also
- ExportingMenu - Customize the export menu
- Annotator - Add annotations before export
- Example: Custom Export Menu