FeaturesPricing
All Charts
Chart.js ChartsLine ChartsSparkline ChartsScatter ChartsPie ChartsDonut ChartsPolar ChartsRadar ChartsBubble ChartsGraph Viz ChartsQR Codes generatorBar Charts
Integrations
Popular Integration
How to Integrate
Google Drive
with Image Charts using Zapier/Make
How to Integrate
Google Forms
with Image Charts using Zapier/Make
How to Integrate
Pipedrive
with Image Charts using Zapier/Make
How to Integrate
Dropbox
with Image Charts using Zapier/Make
How to Integrate
Google Sheets
with Image Charts using Zapier/Make
See all integrations
Resources
BlogDocumentation
Subscription managementBuild your chart for free
Subscription managementBuild your chart for free
Automate!

5 Useful Tips to Know About Chart in Email Transfer

Posted on 
August 20, 2020
Table of contents

One of the easiest and most useful ways to send your image chart is via email transfer. Email marketing is a crucial component of many small and large businesses. It allows business professionals to send statistical information and interpreted data to stakeholders in a very effective manner to connect with them on a personal level.

Most emails consist of a body of text and attachments. Sending charts as attachments restricts the receiver from interpreting it entirely. Sending image charts via email in the form of a URL string helps in the following ways:

  • It generates clickable icons for the email recipient
  • It can be accompanied by an analysis of the statistical information
  • It is visually pleasing
  • It can be customized (unlike sending charts as attachments)

However, exporting chart image in email is something that not a lot of people are familiar with. It requires using programming languages like JavaScript, PHP and C++. Therefore, we have put together this simple and straightforward guide that can help you in sending image charts through email. 

If you want to know how to embed image charts in your email, refer to the guide on our website available here. 

So, let’s begin.

The Benefits of Exporting Chart Image in Email

There are numerous advantages of sending image charts through email to the interested recipients that require the information. Here are some ways in which you can make your email communication beneficial by sending chart images:

  • Increase number of subscribers
  • Send personalized/customized image charts
  • Present statistical data to email recipients in a visually appealing form
  • Represent the standing of your business

The 5 Step Process of Exporting Chart Image in Email

In this section, we will take you through a 5-step process of exporting chart image in email and discuss some useful tips that we have collected to better guide your research.

Step # 1: Creating the URL String for your Image Chart

Using an image chart tool, like Image-Charts, you must first create a URL string for your image chart. The URL string must have:

  • A base URL. For example: https://image-charts.com/chart
  • Add parameters like:
  • Chart type (bar graph, line graph, pie chart etc.)
  • Width (of the chart image)
  • Height (of the chart image)
  • Pixel ratio (of the chart image)
  • Labels
  • Axes
  • Add <img> tag at the end of your URL to embed it into an email

USEFUL TIP: For more complex charts like pie charts, you also need to define parameters like “background color.”

Step # 2: Exporting Chart to Image

The next step is to convert your chart into an image. Image-Charts provides a built in option to export data into the source box. Charts can be exported into common formats like:

  • JPEG
  • PDF
  • CSV
  • SVG
  • XLSX
  • PNG
  • JSON

USEFUL TIP: Choose a format that is most preferred by your email recipients and easily understandable by them. For example, a finished goods manufacturer will most likely communicate using JPEG or PNG formats.

Step # 3: Choosing Between Different Programming Languages

The third step is to decide which programming language you will convert your chart configuration in before exporting chart image in email. 

Consider you created a chart configuration for a simple line graph chart:

chart_config = {
  'type': 'line',
  'data': {
    'labels': ['Year 1', 'Year 2', 'Year 3', 'Year 4'],
    'datasets': [{
      'label': 'Profits',
      'data': [12, 5, 40, 5]
    }, {
      'label': 'Sales',
      'data': [80, 42, 215, 30]
    }]
  }
}))

You must decide which programming language you want to convert your configuration in. Let’s suppose you choose JSON. Your configuration will look something like this:

import json
from urllib.parse import quote

encoded_config = quote(json.dumps(chart_config))
chart_url = f'https://image-charts.com/chart.js/2.8.0?c={encoded_config}'

Step # 4: Adding the Email Message to the Converted Configuration

The 4th step is to add an email message to your configuration that will be sent along with your image chart. Add any message you want to send to the email recipient. The end result will be displayed in the following way:

import json
from urllib.parse import quote

encoded_config = quote(json.dumps(chart_config))
chart_url = f'https://image-charts.com/chart.js/2.8.0?c={encoded_config}'

email_message = f"""Hello, this email body contains a chart image about our yearly sales and profits for your reference. Please see the chart below:
<br><br>
<img src="{chart_url}" />
"""

Step # 5: Emailing Your Configuration Using a Service Provider

The last step is to send your configuration with the email message using any email service provided like Gmail or Outlook. Let’s suppose you are using Gmail. Your encoded configuration will look like this:

import requests

request_url = f'https://mail.google.com /v2/{DOMAIN}/messages'
request = requests.post(request_url, auth=('api', 'your_api_key_here'), data={
    'from': 'myemail@gmail.com',
    'to': 'toemail@xyz.com',
    'subject': 'Updated Sales and Profits Chart Report with Gmail',
    'html': email_message,
})

print(f'Status: {request.status_code}')
print(f'Body:   {request.text}')

And you are done!

Your image chart will be exported along with your email message to the recipient. 

Conclusion

We hope you liked our 5-step tutorial on exporting chart images in email. Visit our website and test our exporting tool today to export your chart image in email. 

Comment below if you have questions about exporting chart images in email or if you want to share your experiences with us. To get notifications or updates on our services, visit our webpage by clicking here.

Tagged:
Automation
Integration
SDK
Francois-Guillaume Ribreau
CEO

Featured Posts

Learn
Raising the Bar—Easy, Automated Bar Charts for Everyday Use
Automate!
Where You Draw the Line–Automated Line Graphs for Everyone
How To's
How to make charts with gradients
How To's
How to create a progress bar chart
Learn
How to Get Started With Image Charts on Zapier
Learn
How to Share Charts on Slack?
Learn
Create Chart with One URL
Automate!
How to connect Image-Charts to Zapier ?

Tags

API
Automation
Bar Charts
Bubble Charts
Charting
Design
Doughnut Charts
Emailing
Graph-viz
GraphViz
Integration
Line Charts
Make
Mobile App
Pie Charts
Polar Charts
Progress Bar Charts
QR Code
Radar Charts
SDK
Scatter Charts
Sparkline Charts
Zapier

Create and send charts in email with Image-Charts

Get started
More Posts

You Might Also Like

Apr 17, 2023
 in 
Automate!

Stop Boring Your Readers: Automate Charts in Emails to Impress the Heck out of Them!

Apr 12, 2023
 in 

Charting Wars: The Battle of Charting Tools – A Comprehensive Comparison Guide

Mar 30, 2023
 in 
How To's

Automate Charts in PDFs via Zapier—The Whys and Hows to Create Dynamic Reports

The most used static chart API in the world

Chart API

Chart.js ChartsLine ChartsSparkline ChartsScatter ChartsPie ChartsDonut ChartsPolar ChartsRadar ChartsBubble ChartsGraph Viz ChartsQR Codes generatorBar Charts

Product

PricingDocumentationSubscription managementChart EditorChange logStatus PageOn Premise

SDKs

JavaScript/NodeJS
PHP
Python
Java
Ruby
C#

Integrations

Zapier integrationMake integrationIntegromat integration

Company

About usBlogOpen SourceSecurity & CompliancePrivacyTermsSupport

Newsletter - Changelog

If you'd like more update regarding Image-Charts in your inbox please do join the newsletter
Subscribe
No spam
Unsubscribe anytime
The most used static chart API in the world