# Generating a data plot, what workflow and nodes should I choose?

**URL:** <https://community.n8n.io/t/generating-a-data-plot-what-workflow-and-nodes-should-i-choose/893>\
**Category:** Questions\
**Created:** [February 25, 2020, 3:02pm UTC](https://community.n8n.io/t/generating-a-data-plot-what-workflow-and-nodes-should-i-choose/893 "2020-02-25T15:02:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ejcb](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@ejcb](https://community.n8n.io/u/ejcb)\
**Post date:** [February 25, 2020, 3:02pm UTC](https://community.n8n.io/t/generating-a-data-plot-what-workflow-and-nodes-should-i-choose/893/1 "2020-02-25T15:02:00Z")

</div>

I’m figuring out the way n8n sends (by Send Email or any other node) a plot generated from data coming, in my case, from Execute Command on either table o JSON format.

What’s the reccomendation to generate and later send such a plot, as I don’t find operations on spreadsheets nodes for that (only append, delete, etc), neither can find a “Graphics” node that accepts data and generate the plot by itself.

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [February 25, 2020, 5:30pm UTC](https://community.n8n.io/t/generating-a-data-plot-what-workflow-and-nodes-should-i-choose/893/2 "2020-02-25T17:30:51Z")

</div>

Sorry there is currently no node or functionality to do that. Guess your best bet is to look if there is some kind of external API to which you can send the data and which then returns the plot as an image.

---

<div class="post-metadata">

**Author:** ![RicardoE105](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ricardoe105/32/550_2.png) [@RicardoE105](https://community.n8n.io/u/RicardoE105)\
**Post date:** [February 25, 2020, 5:48pm UTC](https://community.n8n.io/t/generating-a-data-plot-what-workflow-and-nodes-should-i-choose/893/3 "2020-02-25T17:48:04Z")

</div>

@ejcb I have used this service to add charts to emails. It’s always free as long as you do not mind having the watermark.

> **[Chart Image API as a Service - Image-Charts](https://www.image-charts.com/)**
>
> Embed charts emails, pdf reports, blog post or markdown files. 1 url = 1 chart. Used by Microsoft, Spotify, Dropbox, Magento, ...

---

<div class="post-metadata">

**Author:** ![ejcb](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@ejcb](https://community.n8n.io/u/ejcb)\
**Post date:** [February 25, 2020, 6:57pm UTC](https://community.n8n.io/t/generating-a-data-plot-what-workflow-and-nodes-should-i-choose/893/4 "2020-02-25T18:57:03Z")

</div>

Thank you both. I’ll give image-charts a try, @RicardoE105

Would [Plotly](https://plot.ly/javascript/) for javascript be a (on-premise) good alternative? In that case, as I’m not a javascript programmer I would appreciate orientations (or kind of how-tos) on using plotly via “Function” node

---

<div class="post-metadata">

**Author:** ![RicardoE105](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ricardoe105/32/550_2.png) [@RicardoE105](https://community.n8n.io/u/RicardoE105)\
**Post date:** [February 25, 2020, 8:19pm UTC](https://community.n8n.io/t/generating-a-data-plot-what-workflow-and-nodes-should-i-choose/893/5 "2020-02-25T20:19:59Z")

</div>

@ejcb What are you gonna do with the plot once is done? Send it through email? If so, can I see an example of the email you want to send and the incoming data?

---

<div class="post-metadata">

**Author:** ![ejcb](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@ejcb](https://community.n8n.io/u/ejcb)\
**Post date:** [February 26, 2020, 8:05am UTC](https://community.n8n.io/t/generating-a-data-plot-what-workflow-and-nodes-should-i-choose/893/6 "2020-02-26T08:05:31Z")

</div>

Yes @RicardoE105 , I’ll send the plot through email, as an attachment or however it’s easier.

The data that generates the plot is a space separated values like this (storage status):

> SMVDT01 7088603398144 4910193049600  
> SMVDT02 8771037298688 1227915001856  
> SMVAH01 288972865536 709875466240  
> SMVAH02 1023410176 997824921600  
> SMVAH03 988865888256 9982443520  
> SMVAH04 1139802112 997708529664  
> SMVAH05 9070182400 109846724608  
> SMVBP01 287069700096 12772704256  
> SMVBP02 194047377408 105795026944  
> SMVMA01 158583488512 1404043264  
> SMVMB01 220061499392 3780700536832

And the plot to generate (with some added calculations) is a percent stacked barplot:

 ![](https://europe1.discourse-cdn.com/n8n/original/1X/6a926f9d27e9dde1cadf1724e147871e65c08c73.png)

---

<div class="post-metadata">

**Author:** ![RicardoE105](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ricardoe105/32/550_2.png) [@RicardoE105](https://community.n8n.io/u/RicardoE105)\
**Post date:** [February 26, 2020, 2:40pm UTC](https://community.n8n.io/t/generating-a-data-plot-what-workflow-and-nodes-should-i-choose/893/7 "2020-02-26T14:40:18Z")

</div>

Perfect @ejcb. Check the example below.

I wonder what SaaS are you using currently to send the emails?

Keep in mind that the node called “processingData” should take the incoming data and map it to the data [https://documentation.image-charts.com](https://documentation.image-charts.com) understands.

Again do not hesitate to ask any further questions.

Example of what I got when ran the workflow:

 ![image](https://europe1.discourse-cdn.com/n8n/original/1X/b71e665e8516d080bb41d2413689428085409fe3.png)  
 ![image](https://europe1.discourse-cdn.com/n8n/original/1X/51aed6706e577678141f4e14c6c72b7034764279.png)

Workflow example:

```
{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        280,
        290
      ]
    },
    {
      "parameters": {
        "url": "={{$node[\"processingData\"].json[\"url\"]}}",
        "responseFormat": "file",
        "options": {}
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        700,
        290
      ]
    },
    {
      "parameters": {
        "functionCode": "//this function proccess the data and generates the url\n\nreturn [{\n json: {\n url: 'https://image-charts.com/chart?chbh=20&chco=fdb45c,27c9c2,1869b7&chd=t:5,5,5|10,10,10|15,15,15&chds=0,120&chm=N,000000,0,0,10|N,000000,0,1,10|N,000000,0,2,10|N,000000,1,0,10|N,000000,1,1,10|N,000000,1,2,10|N,000000,2,0,10|N,000000,2,1,10|N,000000,2,2,10&chma=0,0,10,10&chs=700x150&cht=bvs&chxs=0,000000,0,0,_&chxt=y'\n }\n}]"
      },
      "name": "processingData",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        510,
        290
      ]
    },
    {
      "parameters": {
        "operation": "sendHtml",
        "fromEmail": "ricardo@klippedapp.com",
        "toEmail": "ricardoespinoza105@gmail.com",
        "options": {},
        "attachmentsUi": {
          "attachmentsBinary": [
            {
              "property": "data"
            }
          ]
        }
      },
      "name": "Mandrill",
      "type": "n8n-nodes-base.mandrill",
      "typeVersion": 1,
      "position": [
        900,
        290
      ],
      "credentials": {
        "mandrillApi": "asas"
      }
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "processingData",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Mandrill",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "processingData": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![ejcb](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@ejcb](https://community.n8n.io/u/ejcb)\
**Post date:** [February 29, 2020, 7:32pm UTC](https://community.n8n.io/t/generating-a-data-plot-what-workflow-and-nodes-should-i-choose/893/8 "2020-02-29T19:32:15Z")

</div>

@RicardoE105 to get things done I preferred a faster way for me (writing matplotlib python code to produce the plot) but I recognize that’s not the ideal “n8n politics”.

I appreciate your previus answer. This is a better n8n-way to do that, I just couldn’t find the time to check if all features I finally used from matplotlib (not really complex, though) were available on [image-charts.com](http://image-charts.com) to be worth the learning of its API. Hop I can do it next time.

Thanks you

---

<div class="post-metadata">

**Author:** ![RicardoE105](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ricardoe105/32/550_2.png) [@RicardoE105](https://community.n8n.io/u/RicardoE105)\
**Post date:** [February 29, 2020, 11:28pm UTC](https://community.n8n.io/t/generating-a-data-plot-what-workflow-and-nodes-should-i-choose/893/9 "2020-02-29T23:28:31Z")

</div>

@ejcb it makes total sense. If you have any other question just let us know.

---

<div class="post-metadata">

**Author:** ![Gustavo\_Camara](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gustavo_camara/32/86799_2.png) [@Gustavo\_Camara](https://community.n8n.io/u/Gustavo_Camara)\
**Post date:** [June 3, 2025, 12:08pm UTC](https://community.n8n.io/t/generating-a-data-plot-what-workflow-and-nodes-should-i-choose/893/10 "2025-06-03T12:08:45Z")

</div>

how to use it in n8n using data from a mysql query from a node, is there a way to auto do it?
