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

**URL:** https://discourse.nodered.org/t/best-way-to-push-db1-data-series-to-db2-for-chart/91029
**Category:** Dashboard
**Tags:** dashboard-2
**Created:** [16 September 2024 19:15 UTC](https://discourse.nodered.org/t/best-way-to-push-db1-data-series-to-db2-for-chart/91029 "2024-09-16T19:15:38Z")
**Posts on this page:** 8
**Page:** 1

<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: [16 September 2024 19:15 UTC](https://discourse.nodered.org/t/best-way-to-push-db1-data-series-to-db2-for-chart/91029/1 "2024-09-16T19:15:38Z")

</div>

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 ?

```auto
[{"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!

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [16 September 2024 19:31 UTC](https://discourse.nodered.org/t/best-way-to-push-db1-data-series-to-db2-for-chart/91029/2 "2024-09-16T19:31:51Z")

</div>

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](https://dashboard.flowfuse.com/nodes/widgets/ui-chart.html#building-charts)  
You can use msg.action to dynamically `append` or `replace` the chart data

---

<div class="post-metadata">

### Author: ![saraltech](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@saraltech](https://discourse.nodered.org/u/saraltech)
#### Post date: [20 September 2024 18:17 UTC](https://discourse.nodered.org/t/best-way-to-push-db1-data-series-to-db2-for-chart/91029/3 "2024-09-20T18:17:54Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [20 September 2024 18:20 UTC](https://discourse.nodered.org/t/best-way-to-push-db1-data-series-to-db2-for-chart/91029/4 "2024-09-20T18:20:38Z")

</div>

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

---

<div class="post-metadata">

### Author: ![saraltech](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@saraltech](https://discourse.nodered.org/u/saraltech)
#### Post date: [21 September 2024 06:11 UTC](https://discourse.nodered.org/t/best-way-to-push-db1-data-series-to-db2-for-chart/91029/5 "2024-09-21T06:11:44Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/6/466c1db8e360edd7405e50c4051986312c162c0d.png)

Kindly elaborate where I can find Chart Node Config.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [21 September 2024 06:34 UTC](https://discourse.nodered.org/t/best-way-to-push-db1-data-series-to-db2-for-chart/91029/6 "2024-09-21T06:34:40Z")

</div>

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

 ![chrome_screenshot_21 Sep 2024 07_32_58 BST](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/d/ad0cb3f6b2831b67ceb6f60fc993ffee6ea75537.png)

---

<div class="post-metadata">

### Author: ![saraltech](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@saraltech](https://discourse.nodered.org/u/saraltech)
#### Post date: [21 September 2024 07:19 UTC](https://discourse.nodered.org/t/best-way-to-push-db1-data-series-to-db2-for-chart/91029/7 "2024-09-21T07:19:44Z")

</div>

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

---

<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: [5 October 2024 07:20 UTC](https://discourse.nodered.org/t/best-way-to-push-db1-data-series-to-db2-for-chart/91029/8 "2024-10-05T07:20:02Z")

</div>

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