# Why does ui-chart send an output on deploy?

**URL:** https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223
**Category:** Dashboard
**Created:** [30 June 2020 11:45 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223 "2020-06-30T11:45:56Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 June 2020 11:45 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/1 "2020-06-30T11:45:57Z")

</div>

If you have a `ui-chart` connected to a `debug` node (set to display the complete msg object) and do a deploy, the chart node generates a output message that only contains a message id.

Is this an expected action?

Example: add a ui-chart node and connect it to a debug node and deploy - you will get a debug message. Now move the debug node and deploy - again you will get a debug message.

```auto
[{"id":"f3a06472.243898","type":"debug","z":"669c4b6d.12eeec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":650,"y":80,"wires":[]},{"id":"6523ad93.9650a4","type":"ui_chart","z":"669c4b6d.12eeec","name":"","group":"40bd93c3.99ddc4","order":1,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":510,"y":80,"wires":[["f3a06472.243898"]]},{"id":"40bd93c3.99ddc4","type":"ui_group","z":"","name":"G2a","tab":"4a34bda3.d0031c","order":2,"disp":false,"width":"28","collapse":false},{"id":"4a34bda3.d0031c","type":"ui_tab","z":"","name":"GRID","icon":"dashboard","disabled":false,"hidden":false}]

```

 ![Screen Shot 2020-06-30 at 7.45.41 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/4/147945d76939cf3594388ae132c5595121163329.png)

This came about while helping a user on this [thread](https://discourse.nodered.org/t/restore-chart-data-after-power-outage/29159/16)

---

<div class="post-metadata">

### Author: ![Ki-va](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ki-va/32/22283_2.png) [@Ki-va](https://discourse.nodered.org/u/Ki-va)
#### Post date: [30 June 2020 11:49 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/2 "2020-06-30T11:49:40Z")

</div>

thank you ,  
that helps...

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [30 June 2020 11:56 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/3 "2020-06-30T11:56:25Z")

</div>

> [@zenofmud](#):
>
> Now move the debug node and deploy - again you will get a debug message.

This second statement is true only if you do a full deploy, right ? Doing a deploy only for modified flows will not display the debug message.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 June 2020 12:00 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/4 "2020-06-30T12:00:23Z")

</div>

> [@Andrei](#):
>
> This second statement is true only if you do a full deploy, right

Nope, it WILL output a message with 'Modified Flows' - if you look at the icon in the image you will see that the icon indicates modified flows.

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [30 June 2020 12:06 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/5 "2020-06-30T12:06:35Z")

</div>

> [@zenofmud](#):
>
> Nope, it WILL output a message with 'Modified Flows' - if you look at the icon in the image you will see that the icon indicates modified flows.

Interesting. I am getting a different result. If I deploy as modified flow there will be no debug message. I am running:

Node-RED: 1.0.3  
node-red-dashboard: 2.22.1  
Windows 10

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 June 2020 12:17 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/6 "2020-06-30T12:17:13Z")

</div>

Do you have the debug node set to display the complete msg object?  
NR 1.0.6  
dashboard 2.22.1  
macOS

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 June 2020 12:20 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/7 "2020-06-30T12:20:24Z")

</div>

I just installed nr 1.1.0-beta-3 and I no longer see the issue.

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [30 June 2020 12:21 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/8 "2020-06-30T12:21:14Z")

</div>

> [@zenofmud](#):
>
> Do you have the debug node set to display the complete msg object?

Yes, I copy/pasted the flow you posted. It has the debug set to full message.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 June 2020 12:23 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/9 "2020-06-30T12:23:37Z")

</div>

well in NR 1.1.0-Beta-3 if I move the node the issue doesn't happen, ut if I edit the chart node and change the label and deploy I get the output message. Let me try with nr 1.0.3

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 June 2020 12:25 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/10 "2020-06-30T12:25:26Z")

</div>

So with NR 1.0.3 moving the node does not cause the issue, but changing the label will cause it.

(Since it is cool here this morning, I'm off to do some digging in the yard - expanding our strawberry patch.)

---

<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: [30 June 2020 12:51 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/11 "2020-06-30T12:51:39Z")

</div>

With modified flows deploy, if you move the debug connected to the chart it will deploy the chart too. With modified nodes deploy it should not.

---

<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: [30 June 2020 14:32 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/12 "2020-06-30T14:32:07Z")

</div>

I think we have gone off track a bit here worrying about different sorts of deploy. The crux is that when the Chart node is started or restarted it sends out an empty message (apart from id) which messes up flows that use the output to save the chart contents. I don't know whether it has always done that as I don't use that feature, but I am sure it is not supposed to.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 June 2020 14:32 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/13 "2020-06-30T14:32:27Z")

</div>

> [@Colin](#):
>
> if you move the debug connected to the chart it will deploy the chart too

Right, but why is the chart generating a message? That is the question.

---

<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: [30 June 2020 14:33 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/14 "2020-06-30T14:33:16Z")

</div>

> [@zenofmud](#):
>
> why is the chart generating a message? That is the question

That is the question, exactly.

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [30 June 2020 14:40 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/15 "2020-06-30T14:40:56Z")

</div>

> [@Colin](#):
>
> I don't know whether it has always done that as I don't use that feature, but I am sure it is not supposed to.

I use the output of the ui\_chart to persist data since some time (more than one year as far as I can remember). In order to overcome the empty message I used the same strategy that the OP found: a switch node in the output of the ui\_chart node.

 ![a-1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/7/67daef9c72076490f4c123e533d345865fcaf46f.png)

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 June 2020 15:19 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/16 "2020-06-30T15:19:48Z")

</div>

@dceejay - Dave, should the chart out put a msg if there is nothing in the msg other that the msg.id?

---

<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: [30 June 2020 15:35 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/17 "2020-06-30T15:35:48Z")

</div>

And that is with nothing connected to the chart inputs, it still sends a message on startup/deploy.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [30 June 2020 16:08 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/18 "2020-06-30T16:08:07Z")

</div>

Yes. When the dashboard (re)connects it tries to update the widgets to the latest state/set of data that it has for them - which on a clean deploy will be nothing - and then the chart outputs its current state - which is now nothing.

---

<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: [30 June 2020 16:12 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/20 "2020-06-30T16:12:28Z")

</div>

So when using the output to update saved data for re-injecting on startup is the recommended technique to use a Switch node to prevent that from clearing the data? Without the Switch node the result is that it clears the data before it has been injected.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [30 June 2020 16:18 UTC](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223/21 "2020-06-30T16:18:32Z")

</div>

depends if you want to clear it on deploy or not

[Next page](https://discourse.nodered.org/t/why-does-ui-chart-send-an-output-on-deploy/29223.md?page=2)
