V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
xumng123
V2EX  ›  程序员

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

  •  
  •   xumng123 · 2021-11-27 09:12:55 +08:00 via iPhone · 1548 次点击
    这是一个创建于 853 天前的主题,其中的信息可能已经有所发展或是发生改变。
    jquery 生成的 chart 如何自动保存为图片,想插入到邮件附件里
    1 条回复    2021-11-27 09:32:11 +08:00
    vanton
        1
    vanton  
       2021-11-27 09:32:11 +08:00
    # .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
    ```
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2894 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 14:18 · PVG 22:18 · LAX 07:18 · JFK 10:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.