3

jquery 生成的 chart 如何自动保存为图片

 2 years ago
source link: https://www.v2ex.com/t/818302
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

jquery 生成的 chart 如何自动保存为图片

  xumng123 · 10 小时 18 分钟前 via iPhone · 397 次点击
jquery 生成的 chart 如何自动保存为图片,想插入到邮件附件里
1 条回复    2021-11-27 09:32:11 +08:00

vanton

vanton   9 小时 59 分钟前

# .toBase64Image(type?, quality?)

> This returns a base 64 encoded string of the chart in its current state.

```
myLineChart.toBase64Image();
// => returns png data url of the image on the canvas

myLineChart.toBase64Image('image/jpeg', 1)
// => returns a jpeg data url in the highest quality of the canvas
```

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK