Save chartkick chart as image or in pdf using pyth

2019-09-02 03:32发布

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?

1条回答
We Are One
2楼-- · 2019-09-02 04:27

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.

查看更多
登录 后发表回答