Dashboard 2 persistent data in chart node

Is it possible to get persistent data during Node-RED restart/reboot in a dash2 chart node?

In the Dash1 I can use "node-red-contrib-persist" to store all chartdata and automatically reload on restart:

It seems like Dash2/Chart only outputs every single msg received and not the complete chartdata like Dash1/Chart does.

This also makes each topic appear in a more or less random order when the chart is initialized which in turn changes pen colors to the order of which the dara reappears. This problem I have solved with a function sending dummy data with the correct topics on the correct order on reboot:

This is usuallt no big deal but I have a few charts that have an x-axis span of 4 days and even one that is 6 weeks...

There is already a feature request for this. You could add your comments there.

Hi @joepavitt,

I think a native integration would be the best option for users. They will no longer need to go through a database or any other node.

NR offers an API to write and retrieve data: RED.storage.saveLibraryEntry

https://nodered.org/docs/api/storage/methods

I've never used it but in theory it should do the job.

Yeah, this has come up enough times now that we need to pay attention to it. For what it's worth, you can store all of your messages into a context variable or persisted file, and just pass an array of messages back into your chart - that will work, but is more manual that it needs to be.

2 Likes

Thanks all. I did a search before posting but didn't find any posts that I could recognise as a similar feature.

Looks like a solution is not too far in the future...