multi series chart recall

53 views
Skip to first unread message

Thomas Bruyere

unread,
Jun 12, 2017, 12:51:56 PM6/12/17
to Node-RED UI
Hi,

I try to call back more than one graph in chart with dashboard but there is everytime only one coming up.
Is it possible to recall more than one graph in chart ?

If yes, how please ?

Thanks
Thomas

steve rickus

unread,
Jun 12, 2017, 1:12:41 PM6/12/17
to Node-RED UI
Thomas, you may want to read through this discussion on the node-red group first. Much of the later posts deal with the quirks of using the bar chart, instead of line chart, so not relevant for you. If you still have issues, please post your data/flow so we can help you better.
--
Steve

Thomas Bruyere

unread,
Jun 12, 2017, 6:11:46 PM6/12/17
to Node-RED UI
Thx for your answer Steve.

I have tried

[{"key":"Day Litres","values":{"series":["Series-1","Series-2"],"data":[1497024364928,13800,1497024365095,12950]}}]

In this case I have my two series title on the graph but it never show any data.
I have done many test but it is always the same problem, impossible to see any data.

Can you help me with data part syntax ?

Thx
Thomas

steve rickus

unread,
Jun 12, 2017, 9:58:42 PM6/12/17
to Node-RED UI
The data array needs to have individual 2-element arrays of [x,y] values -- in your case x is a timestamp, and y is the litre value.

steve rickus

unread,
Jun 12, 2017, 10:04:12 PM6/12/17
to Node-RED UI
Sorry, didn't mean to hit send yet...

When I inject two different topics/payloads into the ui_chart node, I see the output from port 1 looks like this:

[
 
{
   
"key": "Series 1",
   
"values": [
     
[
       
1497318946348,
       
66
     
],
     
[
       
1497318976351,
       
13
     
],
     
[
       
1497319006353,
       
55
     
],
     
[
       
1497319036354,
       
67
     
]
   
]
 
},
 
{
   
"key": "Series 2",
   
"values": [
     
[
       
1497319071176,
       
88
     
],
     
[
       
1497319101179,
       
73
     
],
     
[
       
1497319131180,
       
87
     
],
     
[
       
1497319161182,
       
54
     
]
   
]
 
}
]

So your msg.payload need to be an array of 2 objects (1 for each series), with the data being an array of [timestamp, value] for each data point.

If you are having trouble getting your json into that format, feel free to post the raw query data here, and i can help you format it...
--
Steve

Thomas Bruyere

unread,
Jun 14, 2017, 5:05:08 PM6/14/17
to Node-RED UI
Really Thanks Steve all is ok now !
Bye

Reply all
Reply to author
Forward
0 new messages