score:22
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:
- Flash charts - this would be blocked by almost all mail clients.
- HTML5 charts - most email clients (including web based ones) will block SVG and also would make "canvas"-driven charts useless as JavaScript will definitely be blocked.
- Pure HTML and CSS charts may work, but since most popular charting libraries use advanced HTML features, most of the charts would not render fine within email.
- Image based charts - Your best bet would be an image of the chart. Since, inline images are widely sent across email clients, my suggestion would be to generate a chart as image and then include it as a part of your HTML mail. Most charting components (like FusionCharts, Highcharts, etc) allow you to generate charts as image.
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.
score:-1
Disclaimer: I am founder of Charty
You can try using Charty , which creates interactive charts in seconds and 25+ chart types were supported.
Link: Charty
score:0
If you're used to building charts in Javascript, rendering large amounts of these charts to images is quite technically involved. You'll need to choose some render service (e.g. a headless browser or canvas implementation) and do a lot of troubleshooting.
I went through this process and released open-source QuickChart, a web API that takes data and generates static images suitable for email. You can see the project here: https://github.com/typpo/quickchart
It's based on the Chart.js API. Given a chart config like this one:
{
type: 'bar',
data: {
labels: [2012, 2013, 2014, 2015, 2016],
datasets: [{
label: 'Data',
data: [12, 6, 5, 18, 12]
}]
}
}
Stuff it into a URL: https://quickchart.io/chart?bkg=white&c={ type: 'bar', data: { labels: [2012, 2013, 2014, 2015, 2016], datasets: [{ label: 'Data', data: [12, 6, 5, 18, 12] }] }}
And it will return a static image:
There is a hosted (also free) version at Quickchart.io, but you can run the web service yourself on Docker or directly from source.
score:3
3.5 years late, but my team at Ramen recently spun out some internal functionality into a standalone product that does just this: 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 we return a Short URL that'll resolve to an image.
There is a free tier, but once you get over a few hundred images per month, we'll ask you to start paying. We've really strived to make the pricing as friendly as possible, though. So it should be a no-brainer if the use case is critical to your business.
It was built on top of http://C3js.org so there's a ton of flexibility in what you can generate.
These URLs can be used in web apps & mobile apps, but the original intent was email charts so I hope this helps!
score:4
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.
Source: stackoverflow.com
Related Query
- Email Charts - Bar, Area and Pie Charts
- Switch between pie charts and bar chart in highcharts
- Highcharts - Bar - Setting the X axis width and the chart area width to be constant
- Laravel 5.5 Console TV Bar Chart High Charts multipleDatasets and label
- How can I put custom color in High Charts PIE data | Slice and want to change slice text
- how to show column and area charts with different y axis with same category and same x axis in highcharts
- Highcharts: stacked bar charts tooltip enable shared and keep display arrow
- Highcharts to get Combined Bar and line charts
- How to create a drilleable bar graph in jsp page using open source charts API
- How to add negative area or background for a specific bar or pie chart in highcharts?
- Combined Chart Highcharts Pie plus Bar grouppadding and pointapadding issue
- Synchronized tooltips positioning with line and horizontal bar charts
- Align second scatter series to the side similar to how column and bar charts do using HighCharts
- Non-fixed svg height? My pie charts have different size even though svg width and pie size are identical. Svg height is fixed, how do i unfix it?
- How to combine Bar chart and data as table in High Charts
- Border is partially hidden on hover in Highcharts column and pie charts
- Adding space between Navigation bar and legend in pie chart(highcharts)
- Area charts in Highcharts: min and minPadding for y-axis
- Maximum bar width in Highcharts column charts
- Making Highcharts.js charts look good on mobile and desktop
- Plot data values inside pie charts slice
- Highcharts - labels inside and outside a pie chart
- Highcharts Pie charts get the selected pie id
- Highcharts Pie Chart ignores percentageDecimals tooltip setting and has floating point inaccuracy issue
- HighCharts - increase bar height and reduce bar gap
- Highcharts pie dataLabels inside and outside
- Can color of data label be different inside and outside of the bar in Highchart
- Links in pie charts for Highcharts.js
- Enable or disable data labels shown in pie charts in Highcharts on click of a button
- How to set plot area width and height in Highcharts?
More Query from same tag
- How we configure highchart x axis start from first tick?
- getJSON different line options
- Gradient on sankey diagram
- How to draw a line on a highcharts graph from an AJAX call?
- Highcharts - async drill-down in tree-map with thousands of items
- Plot float up & down beyond y-axis in StockChart while dragging navigator
- Highcharts Options not working
- Set highcharts datalabel as dropdown list
- how to display two charts on one page using angular2
- Highcharts Node.js export server : Connection error
- How to display array in array on Highcharts? [JS]
- How to build a graph in a div that is still being rendered?
- Custom series connecting line
- Turn long list of items in Highcharts legend into dropdown
- How to use the Linear Gauge Series plugin by Highcharts?
- How to make this as a HighChart (picture attached)
- IE 6 Export Menu size issue
- Labels on the Y axis and grids
- Heat Map With Red Color Range For Negative Values And Green Color Range For Positive Values
- Trying to make master-detail charts in ReactJS
- Set cell size in Heat Map. Highcharts
- How to make Tick lines around Solid Gauge in Highcharts
- PieChart only shows one element
- Discrete bar with highcharts?
- Highcharts is not defined. Error log in console
- Stacked y-Axis on Highcharts, how to make it one?
- chart.series[id].remove() is not able to refresh legend properties of other series in highcharts/highstock
- Align DataLabels of Solidguage in Highcharts
- exporting highcharts polar chart to PDF with phantomjs
- HighCharts Data Structure - Multiple Independent Series, Stacked Column Chart