Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not blocked "Undefined" in ui-chart legend #1575

Open
teluse7 opened this issue Jan 11, 2025 · 9 comments
Open

Not blocked "Undefined" in ui-chart legend #1575

teluse7 opened this issue Jan 11, 2025 · 9 comments
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do

Comments

@teluse7
Copy link

teluse7 commented Jan 11, 2025

Current Behavior

When sending any lines in the data without the necessary keys "series" and "value" , ui-chart works correctly, but returns "undefined" in the legend.

Expected Behavior

Need ability to block "undefined" in legend

Steps To Reproduce

Make the parameter "block undefined in legend" in the ui-chart settings

Environment

  • Dashboard version:
  • Node-RED version:
  • Node.js version:
  • npm version:
  • Platform/OS:
  • Browser:

Have you provided an initial effort estimate for this issue?

I am not a FlowFuse team member

@teluse7 teluse7 added bug Something isn't working needs-triage Needs looking at to decide what to do labels Jan 11, 2025
@joepavitt
Copy link
Collaborator

You can hide the legend already in the chart settings

@teluse7
Copy link
Author

teluse7 commented Jan 12, 2025

You can hide the legend already in the chart settings

I need hide only undefined, not all legend.

@colinl
Copy link
Contributor

colinl commented Jan 12, 2025

It would be better not to send undefined to the chart.

@joepavitt
Copy link
Collaborator

Right, but the only use case where this occurs is when you have a single line of data you're passing to the chart, so there is no need for a Legend? Or, change the "Series" to a hard-coded string to give the line a label.

It is undefined, because the label for the line is quite literally undefined

@teluse7
Copy link
Author

teluse7 commented Jan 12, 2025

Right, but the only use case where this occurs is when you have a single line of data you're passing to the chart, so there is no need for a Legend? Or, change the "Series" to a hard-coded string to give the line a label.

It is undefined, because the label for the line is quite literally undefined

I have a single data flow for many diagrams and some rows for one, some rows for another one. The diagrams themselves now read their own data and do not draw other data. But "undefined" is added to such other rows in the legend. I have normal legend + "undefined". I need block this.

Example:
var output = [
{ 'series400': "Common voltage", 'values400': 401 },
{ 'series230': "Voltage A", 'values230': 235 },
{ 'series230': "Voltage B", 'values230': 230 },
{ 'series230': "Voltage C", 'values230': 232 },
{ 'series400': "Voltage A", 'values400': 402 },
{ 'series400': "Voltage B", 'values400': 400 },
{ 'series400': "Voltage C", 'values400': 401 }
];

msg.payload = output;
return msg;

Screenshot_20250112_155324_Samsung Internet
Screenshot_20250112_155256_Samsung Internet

@joepavitt
Copy link
Collaborator

Ah, okay, so you have instances where a datapoint passed to your chart doesn't actually contain any data to plot. The chart is trying, but failing to, and therefore adding an undefined series?

If so, that makes sense, thank you for clarifying, and something we should handle.

@teluse7
Copy link
Author

teluse7 commented Jan 13, 2025

Yes, you understand everything absolutely correctly now.
Exactly like that.

@teluse7
Copy link
Author

teluse7 commented Jan 14, 2025

what should I do/expect next?

@joepavitt
Copy link
Collaborator

If you're a VueJS developer, you're welcome to dive in and try to fix it. Otherwise, it'll be a matter of waiting until someone is able to pick it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do
Projects
Status: Backlog
Development

No branches or pull requests

3 participants