I want to display Charts in my email - Bar, Area, Pie Charts. I tried a few CSS based Charts with inline styles but it still doesnt show up. Which is the best way to display Charts in email.
Are images the only option ?
Pie charts represent data in a circle, with βslicesβ corresponding to percentages of the whole, whereas bar graphs use bars of different lengths to represent data in a more flexible way.
The bar/column chart excels at showing discrete data while comparing one data-point vs. another, while the pie chart is the classic way to show how various parts makes up a whole. Both make it easy to for readers compare values relative to each other.
Pie charts are best to use when you are trying to compare parts of a whole. They do not show changes over time. an Area Graph. Area graphs are very similar to line graphs.
Email is a ubiquitous format, but it comes with limitations. Mail clients like Gmail and Outlook remove Javascript, SVG, and other alternatives. This means in order to include a chart or graph in email, you must render it as an image.
Disclaimer: I'm Image-Charts founder.
As a indiehacker, I had the same question as you each time I started a new SaaS (rewrite from scratch an image generation backend to then send charts through emails).
That's why I've built a drop-in-replacement for Google Image Charts π and added gif animation on top of it π(chart animations in emails are awesome!!).
It's called Image-charts. No more server-side chart rendering pain, no scaling issues, it's blazing fast, 1 URL = 1 image chart.
Sending HTML email by itself is a tricky job. Various standards and limitations of various mail clients and loads of security restrictions make creating a cross-browser/client HTML email delivery difficult. As a thumb-rule, I feel that the older technology you use, the better it is uniformly reproduced across mail clients. By "older" technology I mean table-driven HTML, inline CSS with very basic CSS attributes, no scripting, etc.
Your possibilities for charts in email:
In case you intend to use image-based charts and yet want it to be dynamically generated, a good trick would be to create a server-side script, to which you would send data via query-string and it would return the image of a chart generated using this data.
If you have any problem deploying image based charts, then you may think about pure HTML based charts that use simple <table>
, <div>
and inline CSS to generate charts. Sadly, I do not think there is a readily available component in the market for that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With