How to export chart as image


Would like to ask how to download the chart as png file? I saw this post about downloading a custom plotly component and am wondering if it is the same approach to download graphs built with retool chart component?


Hey @doris.l!

Happy to help here! I don't believe there is a native way to download a chart specifically as a png although you may be able to do this with external libraries or the custom component. Alternatively, if you don't mind a pdf, you can use the utils function:

utils.downloadPage(fileName, { selectorsToExclude, componentsToExclude, scale, fullscreen })

(link to docs here) to generate a PDF of the chart. Do you think this could work for your use case here?

Hi @Chris-Thompson,

Thank you so much for the reply! I'm a bit hesitant to use utils.downloadPage function. The chart to be downloaded is just a small part of the application, and if using the utils.downloadPage function, there are a lot of components that should be excluded.
I will try it out and let you know how it goes. Thanks again.