Multiple line chart instructions

I am new to node red and I have problems creating simple multiple line chart. I red many examples and watch a lot of videos and I still dont know what I am doing wrong. I came so far that I am getting data to chart but only as a point. There is no real time x axis.

My code:

var l1 = msg.payload.L1; //get payload
var l2 = msg.payload.L2;
var l3 = msg.payload.L3;

var Napetost1 = [{
   "series": ["L1"],
    "data": [l1],
    "labels": [""],
var Napetost2 = [{
    "series": ["L2"],
    "data": [l2],
    "labels": [""],
var Napetost2 = [{
    "series": ["L3"],
    "data": [l3],
    "labels": [""],
msg.payload = [{
    "series": ["L1", "L2", "L3"], 
    "data": [[l1], [l2], [l3]], 
    "labels": [""] }]
return msg;

Please if any one can tell me what I missed in all instructions I read.


Is this a live chart or historical data?
What is the contents of msg.payload?

...It is a live chart. Data is from S7 node.

Is there a reason you only answered one question?

... sorry, but I am not sure what you mean. I collect data from siemens PLC and I am trying to show them in chart. Data from PLC are

I mean the payload going into the function node as above.

... so payload datas are variables of type "Real", I get them from S7 PLC. ?

If you do not give the contents of msg.payload I can not help.

... I realy dont understant what you need, can you show me example, or tell me what to copy?

I require the contents of msg.payload, stick a debug on the s7 node and copy the contents using the copy value button,. Read here for more info on copying values

Please help us help you by reading the documentation and getting a basic understanding of how node-red works.


Help us help you and provide what i asked for in the format i ask. I need you to use the copy value icon, read what i asked you to read, and provide the data as text.

...following payload from function to chart
...folowing payload from s7 to function

example with your incoming payload.


How to import a flow

... sorry but can you explain what did you sent and where I should copy this?

See link provided.

Again please read the documentation and watch the videos, it will make using node-red and asking for help much easier. I said I am a beginer in node red. I read I lot about it but one is theory and other is practical usage. I manage to import your flow. Thank you. I will test it.
Thank you again.

... tested. Working!

Thank you again.

As a 'Beginner' it would be well worth you watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

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