Español

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

Step by step with the HTTP module

Add the HTTP → Make a request module and fill it in like this:

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:

A complete example

A quarterly summary that sends itself:

  1. Google Sheets → Watch New Rows: whenever you add a quarter's figures.
  2. HTTP → Make a request: creates the chart with the four quarters.
  3. 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

OptionValuesWhat it does
typebar, line, pie, doughnut, radarChart type.
labelsList of texts (1 to 50)Axis or slice labels.
seriesList of 1 to 10 seriesEach series is { "name", "data" }. Pie and doughnut use only one.
titleTextChart title.
width / height200 to 2000Size in pixels.
formatpng or svgImage 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.