Create a chart from received data

Hello.

I want to get the payload I've been receiving (in real time) and make a chart through http in and template. Is it possible?

And, is this the right way to organize it?

Thank you.

your hi and bye endpoints are fine - they will serve up whatever is inside template

However, if you expect the function node to update the values in template then that will not work. You might need to store payload in context and use context to update the template.

As with any endpoint, they are only called when the browser makes a request (e.g. refresh/ajax)

PS: If you expect new payloads to update the chart (without the browser doing a request) this will never work. You either need to write clientside websocket and push values to the client OR just use one of the contrib nodes like @flowfuse/node-red-dashboard or node-red-contrib-uibuilder and let them do all the work for you.

1 Like

Thank you for your answer.

So how about using a WebSocket node?

Oh my god. I did what I wanted by following the configuration of that node! Thank you so much.