# How to plot 2D data?

**URL:** <https://discourse.nodered.org/t/how-to-plot-2d-data/28616>\
**Category:** General\
**Created:** [19 June 2020 14:35 UTC](https://discourse.nodered.org/t/how-to-plot-2d-data/28616 "2020-06-19T14:35:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hattori](https://avatars.discourse-cdn.com/v4/letter/h/bb73d2/32.png) [@Hattori](https://discourse.nodered.org/u/Hattori)\
**Post date:** [19 June 2020 14:35 UTC](https://discourse.nodered.org/t/how-to-plot-2d-data/28616/1 "2020-06-19T14:35:18Z")

</div>

this might be a basic question but i cannot figure out how to simply plot 2D data ? I have an array of data that i want to plot in a basic graph, to show the curve.

there is maybe **node-red-node-ui-vega** that seems to be ok, but i don't know **vega** and there should be a node simply doing a **plot(data)**, right ?

---

<div class="post-metadata">

**Author:** ![Bobo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobo/32/8401_2.png) [@Bobo](https://discourse.nodered.org/u/Bobo)\
**Post date:** [19 June 2020 14:42 UTC](https://discourse.nodered.org/t/how-to-plot-2d-data/28616/2 "2020-06-19T14:42:14Z")

</div>

Look at the Dashboard nodes (specifically the Chart node). [https://flows.nodered.org/node/node-red-dashboard](https://flows.nodered.org/node/node-red-dashboard)

---

<div class="post-metadata">

**Author:** ![Hattori](https://avatars.discourse-cdn.com/v4/letter/h/bb73d2/32.png) [@Hattori](https://discourse.nodered.org/u/Hattori)\
**Post date:** [19 June 2020 14:51 UTC](https://discourse.nodered.org/t/how-to-plot-2d-data/28616/3 "2020-06-19T14:51:05Z")

</div>

the chart node is plotting reall time data. What i want is plotting the whole curve in one shot.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 June 2020 15:32 UTC](https://discourse.nodered.org/t/how-to-plot-2d-data/28616/4 "2020-06-19T15:32:41Z")

</div>

You can do that with the chart node provided the x axis is time. Not if it is something else however.

---

<div class="post-metadata">

**Author:** ![Hattori](https://avatars.discourse-cdn.com/v4/letter/h/bb73d2/32.png) [@Hattori](https://discourse.nodered.org/u/Hattori)\
**Post date:** [19 June 2020 15:45 UTC](https://discourse.nodered.org/t/how-to-plot-2d-data/28616/5 "2020-06-19T15:45:32Z")

</div>

the x axis is indeed time in my case, and it works if I give one point after another to the chart node. but if i give it the whole array like, say, [1, 2, 3, 4, 5, 6], it does not print the corresponding curve.  
So if it is possible, can you tell me how ?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 June 2020 15:47 UTC](https://discourse.nodered.org/t/how-to-plot-2d-data/28616/6 "2020-06-19T15:47:56Z")

</div>

I feel I need to attach this text to a hotkey, it is the third time I have posted it today. The link is also mentioned in the Info tab for the chart node in the editor.

If you look at the [these docs](https://github.com/node-red/node-red-dashboard/blob/master/Charts.md) then about half way down it shows you how to structure the data so you can feed it to the chart. Pay careful attention to getting the `data` structure as shown.

---

<div class="post-metadata">

**Author:** ![Hattori](https://avatars.discourse-cdn.com/v4/letter/h/bb73d2/32.png) [@Hattori](https://discourse.nodered.org/u/Hattori)\
**Post date:** [19 June 2020 16:00 UTC](https://discourse.nodered.org/t/how-to-plot-2d-data/28616/7 "2020-06-19T16:00:28Z")

</div>

you maybe should. It is not expected to be that "tricky" to plot simple data. I mean for beginners. But it is maybe because i mostly used python to plot data since months. But thanks ! it works.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 July 2020 16:00 UTC](https://discourse.nodered.org/t/how-to-plot-2d-data/28616/8 "2020-07-03T16:00:30Z")

</div>

Closed on 3 July 2020 16:00 UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
