• 请不要在回答技术问题时复制粘贴 AI 生成的内容
xumng123
V2EX  ›  程序员

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

  •  
  •   xumng123 · Nov 27, 2021 via iPhone · 2174 views
    This topic created in 1665 days ago, the information mentioned may be changed or developed.
    jquery 生成的 chart 如何自动保存为图片,想插入到邮件附件里
    1 replies    2021-11-27 09:32:11 +08:00
    vanton
        1
    vanton  
       Nov 27, 2021
    # .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   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   890 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 19:59 · PVG 03:59 · LAX 12:59 · JFK 15:59
    ♥ Do have faith in what you're doing.