# More Chart questions - sorry folks

**URL:** <https://discourse.nodered.org/t/more-chart-questions-sorry-folks/1822>\
**Category:** General\
**Created:** [26 July 2018 01:17 UTC](https://discourse.nodered.org/t/more-chart-questions-sorry-folks/1822 "2018-07-26T01:17:32Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [18 June 2019 22:55 UTC](https://discourse.nodered.org/t/more-chart-questions-sorry-folks/1822/21 "2019-06-18T22:55:14Z")

</div>

> [@truglodite](#):
>
> Any ideas if/how I could make nodered chart legends work with this?

This is a line chart so you should see the legend when you hover your mouse over the lines of the chart.

---

<div class="post-metadata">

**Author:** ![truglodite](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@truglodite](https://discourse.nodered.org/u/truglodite)\
**Post date:** [21 June 2019 21:44 UTC](https://discourse.nodered.org/t/more-chart-questions-sorry-folks/1822/22 "2019-06-21T21:44:59Z")

</div>

Hovering over the lines does bring up the name... sorta. The line that is "in front" shows it's name as expected, but the line 'in the background' acts a bit spotty when hovering over it. Only like 3 out of the 100 points will display a name when I hover over the background line. I'm guessing it would behave the same if I have more than 2 lines as well.

Regardless, hovering and remembering the name as I absorb the chart is not such a good flow. I really do need the legends for more efficient recognition when looking at the charts.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 June 2019 21:51 UTC](https://discourse.nodered.org/t/more-chart-questions-sorry-folks/1822/23 "2019-06-21T21:51:57Z")

</div>

Did you turn on the legend option ?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d7e36a11cb7dbf75ca1daf2c7b37eca0604a84f5.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/52463d18433774d5a5f1f7a155005b1462d7bca1.png)

---

<div class="post-metadata">

**Author:** ![truglodite](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@truglodite](https://discourse.nodered.org/u/truglodite)\
**Post date:** [22 June 2019 04:54 UTC](https://discourse.nodered.org/t/more-chart-questions-sorry-folks/1822/24 "2019-06-22T04:54:21Z")

</div>

🤦‍♂️ that was just... bad. Yes I did not see that in there. Thanks!

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 June 2019 04:55 UTC](https://discourse.nodered.org/t/more-chart-questions-sorry-folks/1822/25 "2019-06-22T04:55:19Z")

</div>

Hey, we are all allowed to make mistakes.

I am really having a field day with them recently.

---

<div class="post-metadata">

**Author:** ![WhiteLion](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/whitelion/32/12266_2.png) [@WhiteLion](https://discourse.nodered.org/u/WhiteLion)\
**Post date:** [6 October 2019 08:47 UTC](https://discourse.nodered.org/t/more-chart-questions-sorry-folks/1822/26 "2019-10-06T08:47:11Z")

</div>

**EDIT: I made a new topic for this: [click me](https://discourse.nodered.org/t/problems-with-chart-node-multiple-lines/16380)**

I got no suxcess with a chart, using multiple lines. Maybe some can help.  
This is what I have:  
[picture 1](http://puu.sh/EpnpD/3d9d380ace.png)  
[picture 2](http://puu.sh/EpnsP/9e08bab9e2.png)

```auto
var dataArray = [[]];
var seriesArray = []; 
var labelsArray = [""];

for (i=0; i< 5; i++) 
{
    var name = msg.payload[i].brand + " " + msg.payload[i].place + " " + msg.payload[i].street;
    var preis = msg.payload[i].diesel.toFixed(2);
    var dateTime = Date.now();
    var timestamp = Math.floor(dateTime / 1000);

    dataArray[0][i] = {"x":dateTime,"y":preis};
    seriesArray[i] = name;
    //node.send({payload: chart });
}

var chart = [{
    "series":seriesArray,
    "data":dataArray,
    "labels":labelsArray
}];

var chartMsg = {payload: chart};
return chartMsg;

```

Flow needs "Tankerkoenig" + API Id so may be its not so usefull for you:

```auto
[
    {
        "id": "97dfc7db.a3c4d",
        "type": "ui_chart",
        "z": "30b57812.5c8b38",
        "name": "Dieselpreise",
        "group": "107ce709.2e71e1",
        "order": 0,
        "width": "6",
        "height": "6",
        "label": "Diesel",
        "chartType": "line",
        "legend": "true",
        "xformat": "HH:mm:ss",
        "interpolate": "linear",
        "nodata": "Noch keine Daten vorhanden",
        "dot": true,
        "ymin": "1.00",
        "ymax": "2.00",
        "removeOlder": "72",
        "removeOlderPoints": "",
        "removeOlderUnit": "60",
        "cutout": 0,
        "useOneColor": false,
        "colors": [
            "#1f77b4",
            "#aec7e8",
            "#ff7f0e",
            "#2ca02c",
            "#98df8a",
            "#d62728",
            "#ff9896",
            "#9467bd",
            "#c5b0d5"
        ],
        "useOldStyle": false,
        "outputs": 1,
        "x": 1530,
        "y": 560,
        "wires": [
            []
        ]
    },
    {
        "id": "107ce709.2e71e1",
        "type": "ui_group",
        "z": "",
        "name": "wenzlaff.info",
        "tab": "7e68b62d.0b5fa",
        "disp": false,
        "width": "6",
        "collapse": false
    },
    {
        "id": "7e68b62d.0b5fa",
        "type": "ui_tab",
        "z": "",
        "name": "wenzlaff.info",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

```

I am unsure whats wrong, since I see no big differences to the working version of @truglodite  
The chart should show a line for every entry of [seriesArray](http://puu.sh/EpnpD/3d9d380ace.png) and add a new entries without deleding the old once.  
Thanx for your help!

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [6 October 2019 10:07 UTC](https://discourse.nodered.org/t/more-chart-questions-sorry-folks/1822/27 "2019-10-06T10:07:36Z")

</div>

Would be better to open your own topic, but looking at `var dataArray = [[]];`  
~~This does not seem correct.~~ it seems to work.

Your `y` values are strings. Perhaps you can use a `parseFloat(msg.payload[i].diesel)` instead.

---

<div class="post-metadata">

**Author:** ![WhiteLion](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/whitelion/32/12266_2.png) [@WhiteLion](https://discourse.nodered.org/u/WhiteLion)\
**Post date:** [6 October 2019 10:24 UTC](https://discourse.nodered.org/t/more-chart-questions-sorry-folks/1822/28 "2019-10-06T10:24:51Z")

</div>

I changed it to float thx. the Problem remains. I ll open a new topic. - Thank you!

Here I go: [Problems with chart node (multiple lines)](https://discourse.nodered.org/t/problems-with-chart-node-multiple-lines/16380)

[Previous page](https://discourse.nodered.org/t/more-chart-questions-sorry-folks/1822.md?page=1)
