Skip to content

charton API


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

Function: copyChartImage() ​

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

Defined in: ui/src/clipboard.ts:43

Copy a PNG of the chart to the clipboard. Call it from a user action, such as a click: browsers only allow clipboard writes started by one. Rejects when the browser cannot copy images (see canCopyImage), the user denies it, or the chart cannot be captured (captureImage resolved to null). Needs the imageCapture() plugin, which the UI shell adds: without it this rejects with the not-registered ChartError of captureImage.

Parameters ​

chart ​

Chart

options? ​

ClipboardImageOptions = {}

Returns ​

Promise<void>