# Creating two lines in chart

**URL:** <https://discourse.nodered.org/t/creating-two-lines-in-chart/63298>\
**Category:** General\
**Created:** [31 May 2022 11:01 UTC](https://discourse.nodered.org/t/creating-two-lines-in-chart/63298 "2022-05-31T11:01:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Razz](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@Razz](https://discourse.nodered.org/u/Razz)\
**Post date:** [31 May 2022 11:01 UTC](https://discourse.nodered.org/t/creating-two-lines-in-chart/63298/1 "2022-05-31T11:01:05Z")

</div>

Hi everyone,

I am trying to log two registers from a modbus simulator onto a line chart. I am only able to get 1 line graph out so far, and i did some research saying that i would have to label them under different topics in the function node, but am not quite sure how to do it. Any help would be dearly appreciated.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/2/0273a9fa54f249fdc099e9cbfa51075287bc653b.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/d/7dc7fcbc0a71a9b228ab822f2f29848aa77f4791.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/a/6a8d8e45a9452a58535a8f8ca848730e1a0d1834.png)

---

<div class="post-metadata">

**Author:** ![Napest](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/napest/32/55656_2.png) [@Napest](https://discourse.nodered.org/u/Napest)\
**Post date:** [31 May 2022 11:25 UTC](https://discourse.nodered.org/t/creating-two-lines-in-chart/63298/2 "2022-05-31T11:25:31Z")

</div>

Hi,

to simplify the situation use "change" node instead. Change topics for each branch (data1, data1,...) and connect those to the single chart.

Once you get familiar with msg object, you can make step further and use function node.

Stepan

---

<div class="post-metadata">

**Author:** ![Razz](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@Razz](https://discourse.nodered.org/u/Razz)\
**Post date:** [31 May 2022 11:47 UTC](https://discourse.nodered.org/t/creating-two-lines-in-chart/63298/3 "2022-05-31T11:47:23Z")

</div>

Hello Stepan,

Thank you for your suggestion. Will give the node "change" a try. It'd be my first time using this node.

---

<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:** [30 July 2022 11:48 UTC](https://discourse.nodered.org/t/creating-two-lines-in-chart/63298/4 "2022-07-30T11:48:01Z")

</div>

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