Best way to push DB1 data series to DB2 for chart?

I use the payload below to push data to a DB1 line chart... That works nice. What would be the best way to push it to a DB2.0 chart ?

[{"series":["Leitung 1","Leitung 2","Leitung 3","Alle Leitungen"],
"data":[[{"x":1726513821729,"y":0.150636}],[{"x":1726513821729,"y":0.108064}],[{"x":1726513821730,"y":0.105989}],[{"x":1726513821730,"y":0.364689}]],
"labels":[""]}]

thx!

You do not say where your data comes form and if you parse it to that format.

Saying that db2 data can come in an array of objects, i.e a result from a db
[{"timestamp":1111, "temp": 20,"device":"sensor1"},{"timestamp":1111, "temp": 20,"device":"sensor2"}]
You then set the x, y and series key in the chart to x - timestamp, y - temp, series - device.
This allows you to set multiple series using the device property, you can set these keys to any property name you wish.
It is all in the docs of course Chart ui-chart | Node-RED Dashboard 2.0
You can use msg.action to dynamically append or replace the chart data

2 Likes

Dear E1cid,
thanks a lot. It saved me lot of time and efforts. I want to specify the X axis date format. Where can I specify that?

In the chart node config. You can set presets or select custom and set your own format e.g DDD HH:mm etc.

Thanks for quick reply. I don't find option to format X Axis label in the Edit chart node dialog:

Kindly elaborate where I can find Chart Node Config.

I suspect you are using an older version, or you have a browser issue.

1 Like

You are right. I updated the node. Its working now. Thanks a lot.

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