Line chart not populating data

newbie here

So my flow looks like this below experimenting with two temp sensors but I cant get the chart to populate the data.

Would I have to feed into the chart blocks a msg.payload only? I think I am trying to feed in a msg.payload.pv its from a an API response JSON data. Is this why it isnt working?

I was trying to add in a function block to the flow to change the name, basically trim off the .pv at the end. But have something wrong in the javascript code below if its even needed at all...?

var msg.payload=payload.pv;

return msg;

Chart block:

Try msg.payload = msg.payload.pv;

Thanks for the tip so I snapped that into the flow into 2 separate function blocks:

Do these looks chart for the chart setup?

Still not working... Any tips greatly appreciated...

Are you returning the msg at the end of the function?

Ps, is always wise to put a debug just before the thing that's not working then you'll see why it's not working.

1 Like

Your function should be like this - no "var".

msg.payload = msg.payload.pv;
return msg;

Thank for the tips, how much memory can dashboards hold to chart data without a database?

It's the browser memory that can get out of hand since the data is held and processed by the browser not Node-Red.

Don't display more data points than the pixel width of your screen and hopefully memory use will be OK.

Got it so as long as the browser is open for the Node Red dashboard data will display? Else no data is being stored right if the browser isnt being used..?

Not correct, it is also stored in the server so when the browser is opened the data will immediately be visible. However the processor overhead in the browser is much greater as it has to display the data and shuffle it down each time a new point is added.