# Multiple lines on a single chart

**URL:** https://discourse.nodered.org/t/multiple-lines-on-a-single-chart/58104
**Category:** Dashboard
**Created:** [10 February 2022 20:43 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-single-chart/58104 "2022-02-10T20:43:33Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ALOKA1432](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@ALOKA1432](https://discourse.nodered.org/u/ALOKA1432)
#### Post date: [10 February 2022 20:43 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-single-chart/58104/1 "2022-02-10T20:43:33Z")

</div>

Hi everyone, I have four HTTP IN nodes defined in a flow. They all receive information from four devices through HTTP GET request.

The HTTP INs are /Device1, /Device2, /Device3, /Device4

Now I want to show all the data on a single chart irrespective of time of receiving of data from 4 different devices.

How do I proceed ?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [10 February 2022 21:04 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-single-chart/58104/2 "2022-02-10T21:04:20Z")

</div>

I am assuming the data are single point data values, if so just give each device a unique msg.topic and feed them into the chart node.

---

<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: [10 February 2022 21:04 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-single-chart/58104/3 "2022-02-10T21:04:34Z")

</div>

If I understand the question you just feed all the values in separately with different topics. The chart will draw a line for each topic.

---

<div class="post-metadata">

### Author: ![ALOKA1432](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@ALOKA1432](https://discourse.nodered.org/u/ALOKA1432)
#### Post date: [10 February 2022 21:12 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-single-chart/58104/4 "2022-02-10T21:12:26Z")

</div>

hi @Colin,  
i have taken written the function node like this;

msg.payload = [{  
"series": ["ULS1","ULS2","ULS3","ULS4"],  
"data": [[msg.payload.level1],[msg.payload.level2],[msg.payload.level3],[msg.payload.level4]],  
"labels": ["Jan","Jan","Jan","jan"]  
}]  
return msg;

---

<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: [10 February 2022 21:27 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-single-chart/58104/5 "2022-02-10T21:27:33Z")

</div>

Do the values that come in via the http nodes each reflect the current value of a single mearurement in the outside world? If not then you need to tell us more about exactly what you are getting via the http nodes.

If they do each represent a single measurement then you don't need to join them into one message. Just feed each one into the chart in the payload with a topic that identifies that measurement. That is all you need.

---

<div class="post-metadata">

### Author: ![ALOKA1432](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@ALOKA1432](https://discourse.nodered.org/u/ALOKA1432)
#### Post date: [10 February 2022 21:33 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-single-chart/58104/6 "2022-02-10T21:33:42Z")

</div>

@Colin I just did using different topics and it worked like a charm.

Thanks everyone.

---

<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: [24 February 2022 21:34 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-single-chart/58104/7 "2022-02-24T21:34:32Z")

</div>

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