简体   繁体   中英

Save chartkick chart as image or in pdf using python, flask and pisa/ xhtml2pdf

My app is in python using the flask framework. I have a chart that I've generated with chartlink. I'd like to include it on a pdf that I'm outputting with pisa. Is this possible? Is there some way to save the chartkick chart as an image? Or should I look into another chart-generating option like pygal or matplotlib?

According to the chartkick documentation you can give users the option to download an image of the chart.

You will have to include canvg before chartkick.js.

Another option would be to generate the image on a PhantomJS instance and save the screenshot/image.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM