# Chart Legend showing old topics

**URL:** <https://discourse.nodered.org/t/chart-legend-showing-old-topics/38683>\
**Category:** Dashboard\
**Created:** [6 January 2021 21:27 UTC](https://discourse.nodered.org/t/chart-legend-showing-old-topics/38683 "2021-01-06T21:27:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![traderjoe](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@traderjoe](https://discourse.nodered.org/u/traderjoe)\
**Post date:** [6 January 2021 21:27 UTC](https://discourse.nodered.org/t/chart-legend-showing-old-topics/38683/1 "2021-01-06T21:27:30Z")

</div>

I have 2 identical flows. And they do exactly the same thing. In fact when I take my data, even the topics are the same. I figure they won't interfere with each other since they are on different flows.

I'm plotting the data, and I get this:

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

Where you see DC Setpoint 1, DC Actual 1, and Trigger 1 are all old topics. I don't understand why keeps showing up. Likewise with Duty Cycle 2 chart (DC Setpoint 2, DC Actual 2, and Trigger 2. trigger 1 here is also old). I've tried redeploying the project, and refreshing the browser and always shows up. If I mouse over the lines, the correct topics/data shows.

How do I clean up the legend in the chart so it doesn't display old topics anymore?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [6 January 2021 21:29 UTC](https://discourse.nodered.org/t/chart-legend-showing-old-topics/38683/2 "2021-01-06T21:29:52Z")

</div>

Send the chart an empty message.

`msg.payload = [];`

And it should be ok then.

The `chart` gets confused if you change things and don't wipe it. (Been there many times)

---

<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:** [6 January 2021 21:31 UTC](https://discourse.nodered.org/t/chart-legend-showing-old-topics/38683/3 "2021-01-06T21:31:15Z")

</div>

To be precise- send an empty array.

---

<div class="post-metadata">

**Author:** ![traderjoe](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@traderjoe](https://discourse.nodered.org/u/traderjoe)\
**Post date:** [6 January 2021 21:33 UTC](https://discourse.nodered.org/t/chart-legend-showing-old-topics/38683/4 "2021-01-06T21:33:22Z")

</div>

Where do I place that? Rebooting my pi fixed the issue, but I'm trying to avoid this.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [6 January 2021 21:34 UTC](https://discourse.nodered.org/t/chart-legend-showing-old-topics/38683/5 "2021-01-06T21:34:18Z")

</div>

You put _that_ in an `inject` node and then `deploy`. Press the `inject` button and the chart should be wiped.

Then any new data that comes in will be the correct colour.

---

<div class="post-metadata">

**Author:** ![traderjoe](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@traderjoe](https://discourse.nodered.org/u/traderjoe)\
**Post date:** [6 January 2021 21:54 UTC](https://discourse.nodered.org/t/chart-legend-showing-old-topics/38683/6 "2021-01-06T21:54:25Z")

</div>

So like this?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/9/6977d1d02e8944cf2ab0624d895c1676ff40a095.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:** [6 January 2021 21:58 UTC](https://discourse.nodered.org/t/chart-legend-showing-old-topics/38683/7 "2021-01-06T21:58:17Z")

</div>

I'm on phone so can't make pictures but the type must be object. The icon is {} . You have string type currently.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [6 January 2021 22:03 UTC](https://discourse.nodered.org/t/chart-legend-showing-old-topics/38683/8 "2021-01-06T22:03:45Z")

</div>

Though @hotNipi is correct, I think if you put a space between the `[` and `]` it works.  
But if you want to be 100% correct, I can't do more than this offering.

---

<div class="post-metadata">

**Author:** ![traderjoe](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@traderjoe](https://discourse.nodered.org/u/traderjoe)\
**Post date:** [7 January 2021 14:01 UTC](https://discourse.nodered.org/t/chart-legend-showing-old-topics/38683/9 "2021-01-07T14:01:51Z")

</div>

Got it. Its working right now. Thanks!

---

<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:** [21 January 2021 14:01 UTC](https://discourse.nodered.org/t/chart-legend-showing-old-topics/38683/10 "2021-01-21T14:01:52Z")

</div>

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