Stale data not being weeded from chart
Current Behavior
I have a chart being fed data every 5 seconds, and have set the chart config to append data points and x-axis limit to 1 hour. When I first load the chart, or refresh the browser I get exactly that, 1 hour of data. But if I leave the browser connected, the stale data (more than 1 hour old) is not removed from the chart, as per the screenshot. I'm concerned that if the browser was kept connected, that the amount of data (points) being stored would affect the stability of the system due to memory constraints.
Expected Behavior
I expected that chart data older than 1 hour would be removed from the chart after 1 hour, however that is not the case.
Steps To Reproduce
Create a chart configured as above, and leave the browser connected to the chart. Forum link to discussion - https://discourse.nodered.org/t/stale-data-not-being-weeded-from-chart/87039
Environment
- Dashboard version: 1.7.0
- Node-RED version: 3.1.8
- Node.js version: 20.12.0
- npm version: 10.5.0
- Platform/OS: Ubuntu on Oracle cloud server
- Browser: Chrome Version 123.0.6312.106 (Official Build) (64-bit) (Although same result with Edge)
Have you provided an initial effort estimate for this issue?
I am not a FlowFuse team member
Further information... Forum member Paul (zenofmud) commented;
Try adding in 10000 to the points option.
This little flow I played with and you will see the data rolloff the chart as new data comes in once it hits the time limit.
It looks to me that if the count is greater than the number of points that would show in the time limit, only the number of points that fit in the time limit will show and new points will roll off the older points.
[{"id":"9ca6b2461422c2a6","type":"ui-chart","z":"2f464dcf4944f62e","group":"d2c4867136b89fdb","name":"","label":"chart","order":9007199254740991,"chartType":"line","category":"topic","categoryType":"msg","xAxisProperty":"","xAxisPropertyType":"msg","xAxisType":"time","yAxisProperty":"","ymin":"","ymax":"","action":"append","pointShape":"star","pointRadius":4,"showLegend":true,"removeOlder":"1","removeOlderUnit":"60","removeOlderPoints":"100","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"width":6,"height":8,"className":"","x":490,"y":560,"wires":[[]]},{"id":"18f731fd8d23c2eb","type":"random","z":"2f464dcf4944f62e","name":"","low":1,"high":"100","inte":"true","property":"payload","x":320,"y":560,"wires":[["9ca6b2461422c2a6"]]},{"id":"acd7ecd08794350b","type":"inject","z":"2f464dcf4944f62e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"5","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":560,"wires":[["18f731fd8d23c2eb"]]},{"id":"d2c4867136b89fdb","type":"ui-group","name":"Group Name","page":"fbb5c5f6fdf9ef6c","width":"6","height":"1","order":-1,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"fbb5c5f6fdf9ef6c","type":"ui-page","name":"Page Name","ui":"e662da78a987a98f","path":"/d2","icon":"home","layout":"grid","theme":"edb08c2cb16dcc54","order":-1,"className":"","visible":"true","disabled":"false"},{"id":"e662da78a987a98f","type":"ui-base","name":"Testd2","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false},{"id":"edb08c2cb16dcc54","type":"ui-theme","name":"Mytheme","colors":{"surface":"#ffffff","primary":"#0094ce","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]
(see https://discourse.nodered.org/t/stale-data-not-being-weeded-from-chart/87039/7 )