pdf()
Description
Exports a chart to a PDF file
pdf(config?: object): void;
Parameters:
config
- (optional) an object with export settings. You can specify the following settings for export to PDF:url?: string
- (optional) the url of the service that executes export and returns an exported file. This setting is optional, you should use it only if you need to specify the path to your local export service. The default value ishttps://export.dhtmlx.com/chart/pdf/8.0.0
name?: string
- (optional) the name of the exported filepdf?: object
- (optional) the object of pdf options. Here you can specify the following properties:scale?: number
- (optional) defines scales of the chart rendering. Amount must be between 0.1 and 2 valueslandscape?: boolean
- (optional) defines a landscape orientation, false by defaultwidth?: string | boolean
- (optional) defines a width of paper. You can pass in a number or a string with a unitheight?: string | number
- (optional) defines a height of paper. You can pass in a number or a string with a unitmargin?: object
- (optional) the object with paper margins, none by defaultleft?: string | number
- (optional) defines a left margin, accepts values labeled with unitsright?: string | number
- (optional) defines a right margin, accepts values labeled with unitstop?: string | number
- (optional) defines a top margin, accepts values labeled with unitsbottom?: string | number
- (optional) defines a bottom margin, accepts values labeled with units
format?: string
- (optional) defines a paper format. If defined, takes priority over width or height options. The 'Letter' is set by default. Read more about formatting here
Example
// default export
chart.export.pdf();
// export with config settings
chart.export.pdf({
url: "https://export.dhtmlx.com/chart/pdf/8.0.0",
name:"result.pdf"
});
Related samples: Chart. Export. Export to PDF/PNG
Change log: The method was added in v8.0