Home forums Feature Requests & Feedback Export Chart as Image/Get chart data as Base64 format

This topic contains 4 replies, has 2 voices, and was last updated by  sathya 2 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11455

    Hi Team,
    1)Is it possible to automatically save the chart as image in specified folder after chart has been rendered?.In this case,chart should be download without user Interaction. Can I use “ExportEnabled=true” option?.

    1)Is is possible to get the chart data in base64 format?

    Thanks,
    Sathya S

    #11465

    Sathya,

    You can use toDataURL to export chart with the help of initMouseEvent. Here is an example.

    Or you can perform same by setting exportEnabled to true and auto-clicking the link of format of image you like to save as shown in this example. In both the cases, images will in base64 format.

    CanvasJS Export as Image

    #11466

    Vishwas,
    How to change the download location and image name?

    Thanks,
    Sathya

    #11468

    Sathya,

    You can change save.download = 'CanvasJS.png'; in first example to your desired name. Here CanvasJS.png is the image-file name. And in the second example, you can use exportFileName to set image-file name.

    Download location setting is a part of browser setting, it varies from browser-to-browser. You can change it under browser settings. Check these links to change/manage download location in chrome and Firefox.

    #11469

    Vishwas,
    In my project I have to save the chart image in specified folder.Eg:”C:\\MyProject\UserDocuments\Chart1.png. Is there is any option to achieve this?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.