Type class
A plugin that can be used to export chart snapshots and data.
Click here for more info
Sources
Exporting can be used (imported) via one of the following packages.
// Exporting is available in all of the following modules. // You only need to import one of them. /** * -------------------------------------------------------- * Import from: "plugins/exporting.ts" * Use like: am5plugins_exporting.Exporting * -------------------------------------------------------- */ import * as am5plugins_exporting from "@amcharts/amcharts5/plugins/exporting";
// Exporting is available in all of the following modules. // You only need to import one of them. /** * -------------------------------------------------------- * Include via: <script src="plugins/exporting.js"></script> * Access items like: am5plugins_exporting.Exporting * -------------------------------------------------------- */
Inheritance
Exporting extends Entity.
Exporting is not extended by any other symbol.
Settings
Set these settings on a Exporting object using its set() and setAll() methods.
Read about settings concept.
|
backgroundColor # |
Type Export will try to determine background color based on the DOM styles. You can use this setting to explicitly specify background color for exported images. |
|---|---|
|
canvasOptions # |
Canvas format options. |
|
charset # |
Type Charset to use for export. @defaul "utf-8" |
|
csvOptions # |
Type CSV format options. |
|
dataFields # |
Type Fields to include in data export. Key - field in data. Value - column name. |
|
dataFieldsOrder # |
Type Specifies the order of fields to export in data. |
|
dataSource # |
Type Data to export. Click here for more info |
|
dateFields # |
Type Fields in data that have date/time value. |
|
dateFormat # |
Type Use this date format on date values. |
|
durationFields # |
Type Fields in data that need to be formatted as "duration" as per @since 5.0.16 |
|
durationFormat # |
Type Format to use when formatting values in If not set, will use @since 5.0.16 |
|
durationUnit # |
Type Time unit to assume duration values are in. If not set, will use @since 5.0.16 |
|
extraImages # |
Type Include these images or other charts in image exports. |
|
filePrefix # |
Type Default A string to prefix exported files with. |
|
htmlOptions # |
HTML format options. |
|
id # |
Type Inherited from A custom string ID for the element. If set, element can be looked up via Will raise error if an element with the same ID already exists. |
|
jpgOptions # |
JPEG format options. |
|
jsonOptions # |
JSON format options. |
|
menu # |
Type A reference to |
|
numberFormat # |
Type Use this number format on numeric values. |
|
numericFields # |
Type Fields in data that are numeric. |
|
pdfOptions # |
Type PDF format options. |
|
pdfdataOptions # |
PDF with data table format options. |
|
pngOptions # |
PNG format options. |
|
printOptions # |
Print options. |
|
stateAnimationDuration # |
Type Inherited from Duration of transition from one state to another. |
|
stateAnimationEasing # |
Type Inherited from Easing of transition from one state to another. |
|
themeTags # |
Type Inherited from Tags which can be used by the theme rules. Click here for more info |
|
themeTagsSelf # |
Type Inherited from Tags which can be used by the theme rules. These tags only apply to this object, not any children. Click here for more info |
|
themes # |
Type Inherited from A list of themes applied to the element. |
|
title # |
Type Chart title. Used for print, PDF and Excel exports. |
|
userData # |
Type Inherited from A storage for any custom user data that needs to be associated with the element. |
|
xlsxOptions # |
XSLX format options. |
| There are 7 inherited items currently hidden from this list. | |
Private settings
Properties
|
adapters # |
Type Default Inherited from |
|---|---|
|
className # |
Static
Type Default |
|
classNames # |
Static
Type Default |
|
events # |
Type Default Inherited from |
|
root # |
Type Inherited from An instance of @readonly |
|
states # |
Type Default Inherited from |
|
template # |
Type Inherited from @todo needs description |
|
uid # |
Type Default Inherited from Unique ID. |
| There are 6 inherited items currently hidden from this list. | |
Methods
|
animate( options: ) |
Returns Inherited from Animates setting values from current/start values to new ones. Click here for more info |
|---|---|
|
dispose() |
Returns Inherited from Disposes this object. |
|
download( format: ) |
Returns Triggers a download of the chart/data in specific format. |
|
export( format: ) |
Returns Returns data uri of the chart/data in specific format. |
|
exportCSV( customOptions?: ) |
Returns Returns a data:uri representation of a CSV file with chart data. |
|
exportCanvas( customOptions?: ) |
Returns Returns canvas data. |
|
exportHTML( customOptions?: ) |
Returns Returns a data:uri representation of an HTML file with chart data. |
|
exportImage( format: ) |
Returns Returns chart image as a data:uri. |
|
exportJSON( customOptions?: ) |
Returns Returns a data:uri representation of a JSON file with chart data. |
|
exportPDF( customOptions?: ) |
Returns Returns a data:uri representation of a PDF file with chart image. |
|
exportPDFData( customOptions?: ) |
Returns Returns a data:uri representation of a PDF file with chart data. |
|
exportXLSX( customOptions?: ) |
Returns Returns a data:uri representation of an XLSX file with chart data. |
|
get( key: ) |
Returns Inherited from Returns settings value for the specified If there is no value, Click here for more info |
|
getCSV( customOptions?: ) |
Returns Returns a CSV with export data. |
|
getCanvas( options: ) |
Returns Returns a |
|
getData( format: ) |
Returns Returns processed data according to format options. |
|
getHTML( customOptions?: ) |
Returns Returns an HTML with a table with export data. |
|
getJSON( customOptions?: ) |
Returns Returns data in JSON format. |
|
getPDF( customOptions?: ) |
Returns Returns Base64-encoded binary data for a PDF file. |
|
getXLSX( customOptions?: ) |
Returns Returns a data:uri of XLSX data. |
|
hasData() |
Returns Returns |
|
initiatePrint( data: ) |
Returns Initiates print of the chart. |
|
isDisposed() |
Returns Inherited from Returns |
|
isType( type: ) |
Returns Inherited from Checks if element is of certain class (or inherits one). |
|
new( root: ) |
Static Returns Inherited from Use this method to create an instance of this class. Click here for more info |
|
on( key: ) |
Returns Inherited from Sets a callback function to invoke when specific key of settings changes or is set. Click here for more info |
|
print( customOptions?: ) |
Returns Triggers print of the chart. |
|
remove( key: ) |
Returns Inherited from Removes a setting value for the specified Click here for more info |
|
removeAll() |
Returns Inherited from Removes all keys; Click here for more info |
|
set( key: ) |
Returns Inherited from Sets a setting Click here for more info |
|
setAll( settings: ) |
Returns Inherited from Sets multiple settings at once. Click here for more info |
|
setTimeout( fn: () => ) |
Returns Inherited from Creates and returns a "disposable" timeout. |
|
streamFile( uri: ) |
Returns Triggers download of the file. |
|
supportedExportTypes() |
Returns Returns a list of supported export types: image or print. |
|
supportedFormats() |
Returns Returns a list of formats that can be exported in current browser. |
| There are 12 inherited items currently hidden from this list. | |
Events
Add event handlers to Exporting object using its events.on() method.
Read about adding event handlers.
| #dataprocessed |
Param Invoked when data finishes pre-processing for export. |
|---|---|
| #downloadstarted |
Param Invoked when download of the export starts. |
| #exportfinished |
Param { type: Invoked when export finishes. |
| #exportstarted |
Param { type: Invoked when export starts. |
| #pdfdocready |
Param Invoked when PDF export finishes preparing a document. At this point it can still be modified for export. |
| #printstarted |
Param { type: Invoked when print starts. |
| #workbookready |
Param Invoked when XLSX export finishes preparing a workbook. At this point it can still be modified for export. |