# Chart multiple lines

**URL:** <https://discourse.nodered.org/t/chart-multiple-lines/76338>\
**Category:** Dashboard\
**Created:** [9 March 2023 09:15 UTC](https://discourse.nodered.org/t/chart-multiple-lines/76338 "2023-03-09T09:15:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sekuti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sekuti/32/107159_2.png) [@Sekuti](https://discourse.nodered.org/u/Sekuti)\
**Post date:** [9 March 2023 09:15 UTC](https://discourse.nodered.org/t/chart-multiple-lines/76338/1 "2023-03-09T09:15:29Z")

</div>

Hello again. I am trying to read data from csv file and represent them in chart. I took one example from here and modified it . It works fine but only with one line. Can someone help me add additional three lines.  
Code is bellow

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

payload is next "[{"series":["1.Izmena","2.Izmena"],"data":[[{"x":"2023-03-08","y":300.45,"y2":155.7},{"x":"2023-03-09","y":300.45,"y2":155.7},{"x":"2023-03-10","y":300.45,"y2":155.7},{"x":"2023-03-11","y":300.45,"y2":155.7},{"x":"2023-03-12","y":300.45,"y2":155.7},{"x":"2023-03-13","y":300.45,"y2":155.7}]],"labels":["01"]}]"

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [9 March 2023 09:43 UTC](https://discourse.nodered.org/t/chart-multiple-lines/76338/2 "2023-03-09T09:43:26Z")

</div>

Each line on a chart has to be sent as an array of x: , y: objects. You have this

```auto
"data":[
[
{"x":"2023-03-08","y":300.45,"y2":155.7},{"x":"2023-03-09","y":300.45,"y2":155.7},{"x":"2023-03-10","y":300.45,"y2":155.7},
{"x":"2023-03-11","y":300.45,"y2":155.7},{"x":"2023-03-12","y":300.45,"y2":155.7},{"x":"2023-03-13","y":300.45,"y2":155.7}
]
]

```

It should be

```auto
"data":[
[
{"x":"2023-03-08","y":300.45},{"x":"2023-03-09","y":300.45},{"x":"2023-03-10","y":300.45},
{"x":"2023-03-11","y":300.45},{"x":"2023-03-12","y":300.45},{"x":"2023-03-13","y":300.45}
],
[
{"x":"2023-03-08","y":155.7},{"x":"2023-03-09","y":155.7},{"x":"2023-03-10","y":155.7},
{"x":"2023-03-11","y":155.7},{"x":"2023-03-12","y":155.7},{"x":"2023-03-13","y":155.7}
]
]

```

---

<div class="post-metadata">

**Author:** ![Sekuti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sekuti/32/107159_2.png) [@Sekuti](https://discourse.nodered.org/u/Sekuti)\
**Post date:** [9 March 2023 10:49 UTC](https://discourse.nodered.org/t/chart-multiple-lines/76338/3 "2023-03-09T10:49:47Z")

</div>

...jbudd thank you for your tip. Bellow modified program for two lines.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/8/e872a804ecbdb59d18d82c562ee910e6e86a0a26.png)

---

<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:** [8 April 2023 10:50 UTC](https://discourse.nodered.org/t/chart-multiple-lines/76338/4 "2023-04-08T10:50:13Z")

</div>

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