-
Notifications
You must be signed in to change notification settings - Fork 51
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
Comments
You can hide the legend already in the chart settings |
I need hide only undefined, not all legend. |
It would be better not to send |
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 |
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: msg.payload = output; |
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 If so, that makes sense, thank you for clarifying, and something we should handle. |
Yes, you understand everything absolutely correctly now. |
what should I do/expect next? |
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. |
I am not a VueJS developer, I can't even imagine what this VueJS is. to: in the file: I.e. You need to add if (label !== null && label !== undefined) |
But at least you tried to find a solution, and it seems you even managed to fix it. Kudos!! By looking at your fix, it "looks" to me that you found an issue that is not only related to the legend. But in fact it is quite a big overhead that the chart node stores all these faulty datapoints in its memory, and pushes all these datapoints to the frontend where they will be skipped. Moreover after a refresh of the browser page, I assume all these datapoints will be replayed and ignored again. At the end you managed to keep them away from your dashboard ui, but under the cover they will still be used all over the place. That probably won''t be a problem for your use case, but it will be quite a resource bottleneck when a lot of such faulty datapoints are being injected... I have not tested this, but based on your fix code I "think" you can drop all these faulty datapoints as soon as they are being injected into the ui-chart node in the server-side code. Something like this I think, where I have added my comments in capitals, of code I "think" needs to be changed.:
However by doing it this way, the
Don't hesitate to aks me if something is not clear. I have not tested this code, due to lack of free time!! Bart |
if you delete on the server side (I did it at beginning), then the output of the diagram will not get the original flow, but a truncated one and the next diagram or next some other node will not receive the necessary data. you definitely don't need to do this!! I sent the correct code that does not spoil the flow |
Ah yes, good point. As mentioned above I have not yested my code. But at first sight I wouldn't expect my code to change the original input message. So if you enable passthrough, I would expect the next nodes in your flow to get all the original data. Please correct me if I am wrong. I don't know the internals completely for this chart node, so perhaps the modified data somehow finds its way to the output... |
How can I make sure that at least some kind of fix is taken in release ? |
You will need to get it into a pull request, so the Flowfuse people can review and merge it into the master branch of this repository. Take into account that they are currently very busy (on other non-dashboard related stuff) so not sure when they will get to it. Meanwhile - since you have already experimented to filter the datapoints on the server side - it would be very useful if you could also post here how you did that, and why it didn't work. As described in my last post, I don't really understand at the moment why that wouldn't work. Your feedback would really be helpful for any contributor that wants to implement server-side filtering in the future. Thanks!! |
Unfortunately I can't push, I was asked to help, find a place and fix it, I found it, but maybe your version is better. When I made datapoints smaller, only in terms of data quantity, everything in the component moved apart. In theory, your version with empty datapoints should cause an error somewhere on the server side. |
Thanks for your explanation! That will be helpful if anybody wants to look at this in more depth in the near future.
Do you mean you need help to create a pull request for your workaround? If yes, I can explain the basic steps. |
If you can make this request, that would be great. I don't claim any copyright. |
First I thought: lol, that is a good one. Now you have to wait until Joe has time to review and merge it, but he is very busy at the moment with other stuff unfortunately... |
It wasn't about copyright in the legal sense. I just said that I don't know how to push and most likely I won't be able to technically. But if you can do it, that would be great. I don't claim that it will be written that I found a bug. If you push and it will be considered that you found a bug, that's also great. That's what I'm talking about. I helped as much as I could. |
Hello. |
@teluse7 So I first thought that your fix perhaps somehow caused that test to fail. But the failing unit test is not caused by your fix, because I have run it on a Node-RED instance that doesn't contain your fix. |
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
Have you provided an initial effort estimate for this issue?
I am not a FlowFuse team member
The text was updated successfully, but these errors were encountered: