How-to
Charts in email: an image, because nothing else runs
Every email client deletes <script> before rendering. There is no JavaScript, no canvas and no chart library in an inbox — so a live chart in email is a raster PNG behind an <img> tag. Here is how to make that image look right in Gmail, Outlook and a Mailchimp-style builder.
Why it has to be an image
- Scripts are stripped. Gmail, Outlook and Apple Mail remove JavaScript outright, and most also remove embedded objects. A client-side chart library has nothing to run on.
- CSS support is partial and inconsistent. Outlook renders HTML with the Word engine: modern layout, custom web fonts and many background properties do not survive. SVG support is uneven (Gmail does not render it in the message body).
- Media queries are unreliable. You cannot assume a viewport width, so a chart drawn with CSS boxes cannot be trusted to scale or redraw.
- An
<img>with a plain https URL works everywhere. It is the one primitive every client, in every version, still supports. The chart is rendered server-side once, and the client fetches the bytes.
cht=bvs&chs=600x260&chd=t:12,19,14,23&chxl=0:|Mon|Tue|Wed|Thu&chxt=x,y. The same URL is what you paste into an email builder.The embed
<img src="https://urlchart.com/chart?cht=bvs&chs=600x260&chd=t:12,19,14,23&chxl=0:|Mon|Tue|Wed|Thu&chxt=x,y&chco=2f5fe0&chtt=Weekly+signups"
width="600" height="260"
alt="Bar chart of weekly signups: Mon 12, Tue 19, Wed 14, Thu 23."
style="display:block;border:0;max-width:100%;height:auto;">
Three attributes do the work: the absolute https URL, width/height matching chs (so the client reserves the right box even before the image loads), and alt text that repeats the numbers.
Gmail
The Gmail compose window does not accept raw HTML. Two working routes:
- In the compose window: Insert photo → Web address (URL), paste the chart URL. Gmail stores it as a remote image reference, so the image stays fresh as long as the URL is stable.
- Through the Gmail API or a template: send a
multipart/alternativemessage with an HTML part containing the<img>above. This is what automation tools do (see the Zapier and n8n recipes).
Gmail proxies images through googleusercontent.com and caches them. If you change the chart, change the URL — editing the same URL will not reliably show a new image to a recipient whose client already cached the old one.
Outlook (desktop and web)
- Insert the image by URL (Insert → Pictures → This device is the wrong path; use Online pictures, or paste the HTML into an Outlook template).
- Outlook's Word-based renderer respects the
widthandheightattributes more reliably than CSS sizing. Always set both. - Remote images are blocked until the recipient allows them. Outlook shows the
alttext in the placeholder, which is why the alt text carries the numbers. - Avoid CSS background images and
flexboxaround the chart; one plain<img>in a single-cell table is the version that survives.
Mailchimp-style builders
- Image block: most builders only accept uploaded files in their image block. That still works — render the chart, upload the PNG — but the image is a snapshot, not a live URL.
- Custom HTML block: paste the
<img>above. This keeps the remote URL, so the same campaign template renders new numbers every time you send it. - If the builder rewrites or proxies image URLs, check the sent preview: some replace
srcwith their own CDN path. That is fine as long as the fetch on their side succeeds. - Keep the merge tags out of the URL. Personalising the title of a chart changes the URL per recipient and multiplies unique renders; personalise the surrounding text instead.
Paid accounts: the ?key= parameter
Without a key the free tier renders at 60 requests/minute, 1,000 unique renders/month and a canvas of at most 1000 px per side (1 MP); a larger chart is scaled down with a note rather than failing. A paid key raises the limits and the canvas to 3000 px per side (9 MP), and it is added to the image URL like any other query parameter:
https://urlchart.com/chart?cht=bvs&chs=600x260&chd=t:12,19,14,23&chxt=x,y&key=uc_live_…
The key is removed at the edge before the render request and before the cache key, so a paid and a free request for the same chart are the same chart with two tier variants (the free one capped at 1000 px per side / 1 MP), and the key never reaches the render service. A malformed or revoked key returns 401 JSON instead of silently falling back to a free-tier image.
An image URL is public to everyone who receives the email. An <img> cannot send an Authorization header, so the key has to live in the URL — and any recipient can read it in the message source. For external mailings, use a dedicated key for that integration so you can rotate it without touching your other jobs, and treat “key appears in a forwarded email” as a rotation trigger.
Sizing, retina and print
chs=600x260means 600×260 pixels. That is the render size and it is what you put in thewidth/heightattributes.- Retina: request double (
chs=1200x520) and display it at half (width="600" height="260"). There is no device-pixel-ratio parameter in the legacy syntax; double-and-scale is the compatible way to get a crisp image on a 2× screen. - Email width: 600 px is the long-standing safe content width for email; a chart at 600 is the common default. Keep the height to roughly 260–360 px so the message does not require scroll-hunting for the text.
- 24-bit PNG is fine for charts (flat colours compress well). A 600×300 render is usually a few kilobytes to a few tens of kilobytes; check the size if you send to a very large list.
Alt text is not decoration
Most clients block remote images until the recipient opts in, and screen readers never see the pixels at all. Write the alt text as the sentence the chart makes: “Bar chart of weekly signups: Mon 12, Tue 19, Wed 14, Thu 23.” Put the same summary in one line of text above the image, so the email still communicates with images off — and so a broken image is not a blank rectangle.
Changing a chart: version parameters and cache
Chart identity is the query string. Same parameters → same cached PNG for up to a year (successful renders are immutable). Two different kinds of “version” parameter therefore behave very differently:
v=2026-11-18is an ordinary parameter: the parser ignores it (and reports it as ignored), and it becomes part of the URL, so a new version produces a new image and a new cache entry. It is harmless to the chart, but it is a fresh render — use it when you deliberately want a new URL per send, not on every loop iteration._,cb,cachebustandtare stripped by UrlChart before rendering, keying and metering. They cannot bust our cache and they never create a second billed render. They also cannot force a new image, because the effective URL does not change.- To change the chart, change a rendered parameter — the data, the title, a colour. That is what produces new bytes. Recipient-side proxies (Gmail, Outlook) key on the URL too, so a changed parameter is also what gets past their image cache.
Deliverability notes
- Host reputation matters. Images load from
urlchart.comover https; our renders are cached and immutable, so the fetches are cheap for the receiving proxy. Avoid image hosts that are shared with bulk marketing or short-lived domains — a blocked image host makes a legitimate email look like spam. - Inline a hosted image, do not attach the PNG for the main visual. Large attachments raise spam scores and fill inboxes; the hosted URL plus a text summary is the lighter option. Attach only when the deliverable really is a file (the n8n recipe shows the attachment variant).
- Always ship a text fallback. HTML-only mail is a deliverability signal, and image-blocked recipients need the numbers in text. Send
multipart/alternativewith the chart URL and the summary line in the plain-text part. - Authenticate the sending domain (SPF, DKIM, DMARC) and send from a consistent subdomain. The chart URL being reachable does not make the message reputable; the sending domain does.
- Do not hide text behind the image. A chart with an invisible text block is a spam pattern. Keep the visible summary in the body copy.
- Monitor broken embeds. If the image URL 404s (a deleted key, a typo, a retired host), every recipient sees the alt text. The Drop-in Tester checks the parameters of an embed before you send.
Next: Zapier and n8n recipes (with a downloadable n8n workflow) · Getting started · Parameter reference · Pricing