不使用 javascript 的电子邮件中的 Html 图表
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22251381/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Html charts in email without using javascript
提问by J.Williams
I'm looking for nice charts for my newsletter. Since javascript is not email friendly I need an html only solution.
我正在为我的时事通讯寻找漂亮的图表。由于 javascript 不是电子邮件友好的,我需要一个仅 html 的解决方案。
I'll send email once a month with statistics of user's performance and stuff done during the month.
我会每月发送一次电子邮件,其中包含用户表现和当月完成的工作的统计数据。
So what do you think is the best solution? Can I found some nice basic html charts where I can change little in my back-end with user's data?
那么你认为最好的解决方案是什么?我可以找到一些不错的基本 html 图表,在这些图表中我可以在后端使用用户数据进行很少的更改吗?
I know with JS it would be easy, but is not my case. I'll send both to mobile and desktop.
我知道使用 JS 会很容易,但不是我的情况。我将同时发送到移动设备和桌面设备。
Thank you very very much!!
非常非常感谢你!!
采纳答案by John
You can use any scripting language you want pre-send, but the email itself needs to be pure html. The only way you can change its contents after send, is if you link it to a hosted image, and you swap out that image.
您可以使用任何想要预先发送的脚本语言,但电子邮件本身必须是纯 html。发送后更改其内容的唯一方法是将其链接到托管图像,然后换出该图像。
With that being said, if you are after a html email example with a chart to get started, take a look here. It is a fluid template which is the most widely supported technique for mobile, web and desktop browsers.
话虽如此,如果您正在寻找带有图表的 html 电子邮件示例以开始使用,请查看此处。它是一种流体模板,是移动、网络和桌面浏览器支持最广泛的技术。
回答by Ryan Angilly
A little late to the game here, but my team at Ramen recently spun out some internal functionality into a standalone product that does just this: https://ChartURL.com
这里的游戏有点晚了,但我在 Ramen 的团队最近将一些内部功能拆分成一个独立的产品,可以做到这一点:https: //ChartURL.com
You can generate charts on the fly using an "Encrypted URL" scheme, or you can send us huge amounts of data and return a Short URL that'll resolve to an image. These URLs can be used in web apps & mobile apps, but the original intent was email charts so I hope this helps!
您可以使用“加密 URL”方案即时生成图表,或者您可以向我们发送大量数据并返回一个可解析为图像的短 URL。这些 URL 可用于网络应用程序和移动应用程序,但最初的目的是电子邮件图表,所以我希望这会有所帮助!
回答by Ryan Hamilton
I would recommend against trying to attach js/css/html based charts, you will run into a lot of issues. I've wrote a tutorial on generating charts as images and attaching to emails here: http://www.sqldashboards.com/b/send-email-with-graphs/Basically you
我建议不要尝试附加基于 js/css/html 的图表,你会遇到很多问题。我在这里写了一个关于将图表生成为图像并附加到电子邮件的教程:http: //www.sqldashboards.com/b/send-email-with-graphs/基本上你
- Configure mutt to allow sending email
- Generate charts at the command line.
- Send an email, with attachments using mutt
- 配置 mutt 以允许发送电子邮件
- 在命令行生成图表。
- 使用 mutt 发送带有附件的电子邮件
回答by sidney
You can't simply use raw HTML
to get charts. It is simply not possible, just got to use a scripting language to do so, HTML
isn't one.
您不能简单地使用 rawHTML
来获取图表。这是不可能的,只是必须使用一种脚本语言来做到这一点,HTML
不是一个。
If you are willing to use CSS3
to make your chart a reality, I suggest you to check out this good article: http://www.ssiddique.info/dynamic-chart-in-css.html
如果你愿意用来CSS3
让你的图表成为现实,我建议你看看这篇好文章:http: //www.ssiddique.info/dynamic-chart-in-css.html
回答by ntzm
The best idea would be to generate images and send them, as you can't use pure html to make a chart.
最好的主意是生成图像并发送它们,因为您不能使用纯 html 来制作图表。
回答by fauverism
Try creating an animated gif.
尝试创建动画 gif。
http://www.emailology.org/might have something for you.
http://www.emailology.org/可能有适合你的东西。