# Chart Dashboard 2.0

**URL:** <https://discourse.nodered.org/t/chart-dashboard-2-0/88757>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [17 June 2024 12:46 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757 "2024-06-17T12:46:11Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![PRABHAKAR82](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@PRABHAKAR82](https://discourse.nodered.org/u/PRABHAKAR82)\
**Post date:** [17 June 2024 12:46 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/1 "2024-06-17T12:46:11Z")

</div>

I am trying to plot a chart using MySQL data in dashboard 2.0 but it is not working. while it is working on the chart of old node-red-dashboard.  
Please see the flow.  
[flows (2).json](https://discourse.nodered.org/uploads/short-url/rZaD5UfjQREoqCPWKXsi4qdGdDT.json) (49.7 KB)

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [17 June 2024 15:44 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/2 "2024-06-17T15:44:37Z")

</div>

Dashboard 2.0 is not backward compatible.

One of the joys, and big changes we made for of Dashboard 2.0, is that you don't need to separate and pre-format your data.

Instead of having multiple arrays, all duplicating data as you have it currently, you can just use the output from SQL directly, and have a single array containing the relevant data in each object, e.g:

```js
[{
    "DateTime": "2024-06-17 14:23:24"
    "Carbon Monoxide": 1
    "Oxygen": 20,
    "Light Intensity": 134,
    "Temperature": 29.3,
    "Humidity": 45
}, 
...]

```

Then, on the options of your chart, choose series type to be "JSON", and define each of your series there:

 ![Screenshot 2024-06-17 at 16.44.11](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/f/0f424b4d648ef162852f94361f6ef02f47c05880.png)

You can read more about this property here: [Chart ui-chart | Node-RED Dashboard 2.0](https://dashboard.flowfuse.com/nodes/widgets/ui-chart.html#working-with-data)

---

<div class="post-metadata">

**Author:** ![PRABHAKAR82](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@PRABHAKAR82](https://discourse.nodered.org/u/PRABHAKAR82)\
**Post date:** [17 June 2024 16:38 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/3 "2024-06-17T16:38:57Z")

</div>

[flows (1).json](https://discourse.nodered.org/uploads/short-url/rwa1AcvCh00I4AUMDwmBCXORWoq.json) (3.9 KB)  
I tried as you said but it's not working, please see my flow and correct me.

 ![CHART](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/a/4abdc263c23dc29ee7421adfb81709bd9f6d2842.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 June 2024 18:08 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/4 "2024-06-17T18:08:46Z")

</div>

Feed the data into a debug node and show us what you are sending the node. Also show us how you have configured it.

---

<div class="post-metadata">

**Author:** ![PRABHAKAR82](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@PRABHAKAR82](https://discourse.nodered.org/u/PRABHAKAR82)\
**Post date:** [17 June 2024 18:12 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/5 "2024-06-17T18:12:48Z")

</div>

![NODE-RED](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/1/21afe0838e149fac13035b4c3d39f2aa845102d5.png)

 ![NODE-RED2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/6/160c24bd385cf7cea1f5d10b619b38edd264e44d.png)

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [17 June 2024 18:33 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/6 "2024-06-17T18:33:50Z")

</div>

This is not valid date

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/95a508ee5091d487739355b0a2c642c58a3e9e66.png)

---

<div class="post-metadata">

**Author:** ![PRABHAKAR82](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@PRABHAKAR82](https://discourse.nodered.org/u/PRABHAKAR82)\
**Post date:** [17 June 2024 18:43 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/7 "2024-06-17T18:43:21Z")

</div>

![CHART2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/1/a17d4680dcf03bbe9092346a0ed6e0aeb8348828.png)

I corrected the time, but it is still not working.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [17 June 2024 19:08 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/8 "2024-06-17T19:08:28Z")

</div>

True. Chart node doesn't take this time format. `2024-06-17T13:21:33` does work. Also if to parse it for example with `Date.parse("2024-06-17 13:21:33")` it works. But not directly with the format you have. May be a bug. Maybe not.

---

<div class="post-metadata">

**Author:** ![PRABHAKAR82](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@PRABHAKAR82](https://discourse.nodered.org/u/PRABHAKAR82)\
**Post date:** [17 June 2024 19:15 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/9 "2024-06-17T19:15:04Z")

</div>

![n3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/f/af7787285ac859773c7d284047596859bef58f30.png)  
I corrected the time, but it is still not working.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [17 June 2024 19:16 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/10 "2024-06-17T19:16:03Z")

</div>

Send an empty array to clear the chart before send new data.

---

<div class="post-metadata">

**Author:** ![PRABHAKAR82](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@PRABHAKAR82](https://discourse.nodered.org/u/PRABHAKAR82)\
**Post date:** [17 June 2024 19:23 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/11 "2024-06-17T19:23:41Z")

</div>

[flows (2).json](https://discourse.nodered.org/uploads/short-url/pDGOVdouEcK5EkynoB1JlWXGwlu.json) (4.5 KB)  
Please see the flow, I also send empty array, but it doesn't work.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [17 June 2024 19:31 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/12 "2024-06-17T19:31:41Z")

</div>

Make this change also

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d03ff33c05a222c4c64b9ae495f8bcc6b3ec8a3a.png)

---

<div class="post-metadata">

**Author:** ![PRABHAKAR82](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@PRABHAKAR82](https://discourse.nodered.org/u/PRABHAKAR82)\
**Post date:** [17 June 2024 19:37 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/13 "2024-06-17T19:37:03Z")

</div>

Your kind support is greatly appreciated. Finally, it is working.

---

<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:** [1 July 2024 19:37 UTC](https://discourse.nodered.org/t/chart-dashboard-2-0/88757/14 "2024-07-01T19:37:31Z")

</div>

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