简体   繁体   English

将图表下载为jpg而不是png

[英]download chart as jpg instead of png

I find react-chartkick (based on chartkick ) very useful and easy for integration. 我发现react-chartkick (基于chartkick )非常有用并且易于集成。

I use also its download-charts feature. 我也使用它的下载图表功能。

The only problem is that I have to provide a way to download the chart as jpg image and it looks like there is no such an option (it always creates a png file). 唯一的问题是,我必须提供一种将图表下载为jpg图像的方法,并且看起来没有这样的选项(它总是创建png文件)。 Am I missing anything? 我有什么想念的吗? Any idea for solution? 有解决方案的主意吗?

Here is the issue I've opened on GitHub. 是我在GitHub上打开的问题。

You can just specify the filename in the download option. 您可以只在download选项中指定文件名。

{download: "chart.jpg"}

See this fiddle for usage. 有关用法,请参见此小提琴

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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