# Confusion, on my part, about how to change chart legend... series labels?

**URL:** <https://discourse.nodered.org/t/confusion-on-my-part-about-how-to-change-chart-legend-series-labels/82382>\
**Category:** General\
**Created:** [27 October 2023 05:15 UTC](https://discourse.nodered.org/t/confusion-on-my-part-about-how-to-change-chart-legend-series-labels/82382 "2023-10-27T05:15:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)\
**Post date:** [27 October 2023 05:15 UTC](https://discourse.nodered.org/t/confusion-on-my-part-about-how-to-change-chart-legend-series-labels/82382/1 "2023-10-27T05:15:10Z")

</div>

Confusion, on my part, about how to change chart legend... series labels?

I know you can initialize a chart with labels, data, series information from scratch in a payload, but I have a chart that has received data and I just want to change the legend, after the chart is populated, for an already defined set of series.

I figured, [{'labels': theLabels}];, where theLabels is just an array of strings. But all I get is 'Bad data inject' which suggests you can't update or change labels once a series is established? Tell me there is a way?

I have a ui-table that is updated dynamically, with a list of web sites, each site is monitored via ping and other statistics, the operator can change this table at anytime, so I never know the list of sites before hand. Even then, sending the raw data points to a ui-chart object is easy, just set the topic and done. But the default labels are 0,1,2, etc. or some such. How do I change such? Wonder why the legend does not just use the topic strings? That would make the labeling easy!

As far as I know, I can't do [{"labels":, "data":[], "series":}] as a payload, initialization of the chart, would blow out all the data already present in the chart?

---

<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:** [27 October 2023 07:21 UTC](https://discourse.nodered.org/t/confusion-on-my-part-about-how-to-change-chart-legend-series-labels/82382/2 "2023-10-27T07:21:14Z")

</div>

> [@Nodi.Rubrum](#):
>
> why the legend does not just use the topic strings? That would make the labeling easy!

As far as I have seen it does use the topic string, can you share a simple example flow demonstrating the issue.

---

<div class="post-metadata">

**Author:** ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)\
**Post date:** [12 December 2023 16:26 UTC](https://discourse.nodered.org/t/confusion-on-my-part-about-how-to-change-chart-legend-series-labels/82382/3 "2023-12-12T16:26:18Z")

</div>

Yeah... I have not had a chance to get back to this. Will do. Just need to cut down the flow to illustrate.

---

<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:** [10 February 2024 16:27 UTC](https://discourse.nodered.org/t/confusion-on-my-part-about-how-to-change-chart-legend-series-labels/82382/4 "2024-02-10T16:27:07Z")

</div>

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