# Multiple lines on a chart- not working -"labels" are not pushed

**URL:** https://discourse.nodered.org/t/multiple-lines-on-a-chart-not-working-labels-are-not-pushed/41554
**Category:** Dashboard
**Created:** [24 February 2021 13:50 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-chart-not-working-labels-are-not-pushed/41554 "2021-02-24T13:50:24Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![A.K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/a.k/32/37844_2.png) [@A.K](https://discourse.nodered.org/u/A.K)
#### Post date: [24 February 2021 13:50 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-chart-not-working-labels-are-not-pushed/41554/1 "2021-02-24T13:50:24Z")

</div>

Hi,

I have made a project in which the points come from mySQL and are listed in ui\_template.  
By selecting each point, that point will be added to the chart array.![History|690x298]

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/0/90f2bcfc4a4790c4a444041fa0e732de8a06aef8.png)

**The problem:**  
Although _series_ and _data_ are adding to the chart payload, but it is not possible to see the graphs on UI.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/b/4ba82db7794ebb4e28d41f0cd5e4f2953c6edde1.png)  
In a function I make the _Custom Past Hours_. This function is directly connected to the chart.

During pushing the chart format, I add **series** , **data** and **labels** to the array, but after deploying, the **labels** is not shown in the debug.

- Even if one point is selected, still the graph is not made on UI.
- If I use any other keyword except **labels** , pushing process will be successful.

I've reviewed related posts, specially by @hotNipi, but so far couldn't find a solution.

_(Node-red version: 1.2.7)_

Thanks in advance,

---

<div class="post-metadata">

### Author: ![A.K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/a.k/32/37844_2.png) [@A.K](https://discourse.nodered.org/u/A.K)
#### Post date: [24 February 2021 14:04 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-chart-not-working-labels-are-not-pushed/41554/2 "2021-02-24T14:04:43Z")

</div>

in _ui\_control -\>options-\>scales-\> xAxes_, the custom hours are formed:

**labels:**

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/3/93f0738305f87a0fe050c11041787fbaa569e5cf.png)

---

<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: [24 February 2021 14:17 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-chart-not-working-labels-are-not-pushed/41554/3 "2021-02-24T14:17:19Z")

</div>

Welcome to the forum @A.K.

That is very odd. Is the debug node directly after the function node?

Can you create a very simple flow with just an inject node, a function node and a debug node using a slightly modified version of your function which demonstrates the problem?

This function node generates an output containing labels as expected.

```auto
var allCharts = [];
var A = [];
flow.set("B", [])
var C =[];
C.push("");
allCharts.push({series:A,data:flow.get("B"),labels:C});
msg.payload = allCharts;
return msg;

```

---

<div class="post-metadata">

### Author: ![A.K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/a.k/32/37844_2.png) [@A.K](https://discourse.nodered.org/u/A.K)
#### Post date: [24 February 2021 14:44 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-chart-not-working-labels-are-not-pushed/41554/4 "2021-02-24T14:44:07Z")

</div>

In my project, debug node is after chart node.  
you are right! it should work, and as you see in the function, I have exactly the same code as yours.

Also I made a simple one as you said with an inject and debug node, and it is working:

 ![Untitled-2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/e/7ec2258fc6433eeb28218b758787461ca7394aaf.png)

but in my project still I have a problem!

---

<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: [24 February 2021 14:55 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-chart-not-working-labels-are-not-pushed/41554/5 "2021-02-24T14:55:23Z")

</div>

OK, so the labels are probably not the issue. Show us what is going into the chart and expand a few elements of the arrays so we can see what you are passing in.  
Also, temporarily, configure the chart manually with appropriate settings and disable the node that uses ui\_control to set it up. Then you will know that the data going in is ok.

**[Edit]** Possibly the reason that labels doesn't appear coming out of the chart is that the chart is not bothering to send it on because it is empty. I think if you look what is going _into_ the chart you will see it is there. Concentrate on what is going into the chart for the moment.

---

<div class="post-metadata">

### Author: ![A.K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/a.k/32/37844_2.png) [@A.K](https://discourse.nodered.org/u/A.K)
#### Post date: [24 February 2021 15:14 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-chart-not-working-labels-are-not-pushed/41554/6 "2021-02-24T15:14:05Z")

</div>

Chart without ui\_control:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b88e40899b11a4657339c74d7c6a83dcb6b84c3d.png)

---

<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: [24 February 2021 15:27 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-chart-not-working-labels-are-not-pushed/41554/7 "2021-02-24T15:27:46Z")

</div>

The values in the data array should be x and y, not timestamp and value. See [node-red-dashboard/Charts.md at master · node-red/node-red-dashboard · GitHub](https://github.com/node-red/node-red-dashboard/blob/master/Charts.md)  
Also till you get it going expand the timescale on the chart to 24 hours to make sure the data are not off the front.  
Do you realise you are feeding three series, each containing 17000 points to the chart? To be drawn on a chart which is, I assume, a few hundred pixels across. So probably for each line you have 40 pixels all drawn on top of each other. I hope the machine running the browser is reasonably high powered or the browser will grind to a halt under the onslaught of 50,000 points to plot.

---

<div class="post-metadata">

### Author: ![A.K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/a.k/32/37844_2.png) [@A.K](https://discourse.nodered.org/u/A.K)
#### Post date: [24 February 2021 16:29 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-chart-not-working-labels-are-not-pushed/41554/8 "2021-02-24T16:29:20Z")

</div>

Dear @Colin, it is solved!

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

The problem was timestamp,value as the columns in my DB.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/5/35901d36645aa09d55e9383535c2fdc1c7b1e535.png)

I was using the same columns for single chart and it was working for that purpose.

By the way, no worries for the 17000 points, because I am still filtering them to smaller number.  
Anyways it is working as I wanted and thank you so much for the help.

**[EDIT:]**  
I still cannot see the **labels** , but graphs are drawn as I need.

---

<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: [10 March 2021 16:29 UTC](https://discourse.nodered.org/t/multiple-lines-on-a-chart-not-working-labels-are-not-pushed/41554/9 "2021-03-10T16:29:32Z")

</div>

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