Lee este artículo en español.
How to create charts in Make from your data
In Make it's easy to pull data together from lots of places: Google Sheets, your CRM, your shop. What isn't so easy is showing it. A chart in the team channel or in Monday's email is much easier to read than a row of numbers.
Make has no module for drawing charts, but it does have the HTTP module. With it you call the Cofferdock API, which takes your labels and values and returns the chart image.
What you'll get
A PNG with a bar, line, pie, doughnut or radar chart, built from the data you already have in your scenario. The file comes out of the HTTP module ready to upload to Slack, attach to an email or save to Google Drive.
What you need
- A Cofferdock account (the free plan gives you 50 credits a month, no card needed).
- Your API key, which you create in the dashboard with "+ Create key".
- A Make scenario with the data you want to chart.
Step by step with the HTTP module
Add the HTTP → Make a request module and fill it in like this:
- URL:
https://api.cofferdock.com/chart - Method:
POST - Headers: add one with Name
x-api-keyand your key as the Value. - Body type:
Raw - Content type:
JSON (application/json) - Parse response:
No(we want the file, not text).
In Request content, paste the chart JSON. Here's an example with four values coming from a Google Sheets row (module 1 in the scenario):
{
"type": "bar",
"title": "Sales by quarter",
"labels": ["Q1", "Q2", "Q3", "Q4"],
"series": [
{ "name": "Sales", "data": [{{1.Q1}}, {{1.Q2}}, {{1.Q3}}, {{1.Q4}}] }
],
"width": 800,
"height": 500,
"output": "binary"
}
You pick the {{1.Q1}} parts in Make's mapping panel by clicking the row's fields. Since they're numbers, they go without quotes. The output: "binary" field makes the response the image itself.
What to do with the image
The HTTP module's response carries the file in the Data field. In the next module:
- Google Drive → Upload a File: set File name to
chart.pngand map the HTTP module's Data field into Data. - Slack → Upload a File: same thing, name and data.
- Gmail → Send an email: under Attachments, add one with that name and that data.
A complete example
A quarterly summary that sends itself:
- Google Sheets → Watch New Rows: whenever you add a quarter's figures.
- HTTP → Make a request: creates the chart with the four quarters.
- Gmail → Send an email: sends it to management with the chart attached.
What if the data comes in several rows?
If each row is a day or a product, you need to gather the values first. Use an Array aggregator after the module that reads the rows and, in the HTTP body, turn that list into text with the join function. For the labels, for example:
"labels": ["{{join(map(2.array; "Day"); "\",\"")}}"]
and for the numbers, without quotes around them:
"data": [{{join(map(2.array; "Sales"); ",")}}]
Replace 2 with the number of your aggregator, and Day and Sales with your column names.
Options you can change
| Option | Values | What it does |
|---|---|---|
type | bar, line, pie, doughnut, radar | Chart type. |
labels | List of texts (1 to 50) | Axis or slice labels. |
series | List of 1 to 10 series | Each series is { "name", "data" }. Pie and doughnut use only one. |
title | Text | Chart title. |
width / height | 200 to 2000 | Size in pixels. |
format | png or svg | Image format. |
How much does it cost?
Each chart uses 1 credit from your plan, from the same balance as every other Cofferdock tool.
FAQ
Does Make have a chart module? Not out of the box. You do it with the HTTP module and the Cofferdock API.
The HTTP module gives me a 400 error. It's almost always the JSON: extra commas, numbers in quotes, or a series with more or fewer values than labels. The error message tells you which field is wrong.
Can I get a link instead of the file? Yes. Set "output": "url" and Parse response to Yes. You'll get a link that lasts 15 minutes.
Try it
Every option is on the chart tool page. If you don't have an account yet, create one for free and try the example in your scenario.