I hope you're doing well. I am currently working on a real-time weather application with Node-RED and I have a question regarding data visualization on graphs, for example, temperature.
I'm facing an issue with how the data is displayed over time. As new data is collected, the origin of the time axis (for example, 5:00 PM for an initial temperature of 10°C) shifts. I would like to know if it's possible to fix the first value of the x-axis (for example, 5:00 PM) while dynamically adjusting the last point, so that the graph shows a rolling 24-hour period with an automatically updated interval.
Do you have any suggestions or advice on how to resolve this issue? Thank you in advance for your help.
The chart nodes is consuming a lot of memory (and has a memory leak in D2). Therefore I'm using Grafana to setup my dashboards and showing them with iframe in Node-Red dashboard!
You can specify any timeline you want .. I have a slider at the bottom to adjust the number of hours I want to watch into the past
I had setup several charts to display weather information. The data was read from https://api.open-meteo.com/ and than transformed into the array for the charts. When running the dashboard for 24-36 hours, the browser (Windows Chrome in my instance) is crashing and showing white-page with error message "Oups ..out of memory" .. when disabling the charts (see below) the dasboard is running for days and weeks.
You have shared only one node (an http request). Please select the charts and export those. Rather than attaching a file please paste the flow text here. In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)
yeah .. I tried that but getting the error "An error occurred: Body is limited to 32000 characters; you entered 41388." when adding the code with the ```
sorry can only upload again .. this time not just the http chart_code.json (39.8 KB)
@xx_Nexus_xx Thank you very much for your response. I'm still a beginner with Node-RED, so I will try to fully understand your answer, and if I have any questions, I will ask them, if that's alright with you. Once again, thank you for your response and your help
You are welcome.... as this is Node-Red there are plenty of ways to achieve an outcome .. it really depends on you personal preference ... but thats the fun of it
If you set the x-Axis limit to 24 hours you should get a graph (after 24 hrs) that runs from current time on the right to 24 hrs ago on the left. This one is a simple chart using the incoming data as sent by sensor
in this example I have 6 chart-graphs with upto 2190 datapoints ... should not be a problem
the chart-graph is configure to "replace" the data every time a new set arrives .. therefore there should not be any increase in buffer usage (so my understanding) .. the above charts are getting updated every hour
unfortunately, when running this flow over 24-36 hous, the browser (Chrome in my case) is crashing with ""Oups ..out of memory" message .. it works well after a normal refresh (F5).. but is a bit "wife-unfriendly" when running on my wall-mounted control dashboard in the living-room
since I disabled the chart nodes about 6 weeks ago, the browser did not crash at all. The flow till the function node "to graph" is still running as I'm using the data for further automation
I think this is now getting off-topic of this thread .. but I'm happy to provide more input in this or another thread
I think probably you should submit an issue report at Issues · FlowFuse/node-red-dashboard · GitHub giving the details that you have posted here. Your use case is unusual and perhaps there is a memory leak in the browser code. Though if you are only updating once an hour it seems surprising as not much data will have been transferred. Are you sure it only sends data to the charts once an hour? To confirm this, add debug nodes showing the data going to the chart.
When you replace existing data points will they have exactly the same timestamps as before?
I presume you are using the latest version of the dashboard (1.18.1).