Skip to content

charton API


charton API / @chart-on/ui / index / printChart

Function: printChart() ​

printChart(chart, options?): Promise<void>

Defined in: ui/src/print.ts:29

Print the chart: an image of it (see PrintOptions) in a print-only view sized to the page, then the browser's print dialog. The page itself stays as it is on screen; while printing, only the image prints. The view is removed when the dialog closes (afterprint), or by the next call. Resolves then; rejects when the chart cannot be captured, or with the not-registered ChartError of a chart without the imageCapture() plugin (the UI shell adds it). Call it from a user action, as some browsers block print dialogs opened without one.

Parameters ​

chart ​

Chart

options? ​

PrintOptions = {}

Returns ​

Promise<void>