Dashboard chart will only display last few minutes

#21

I am out of ideas, sorry. There must be something unusual about your system, but I have no idea what.
You haven't installed any other dashboard type nodes have you that might conflict with the chart node?
If you make a new mini-flow with just an inject and a chart does it exhibit the problem? If so, export that flow so we can confirm that it works for us. Do you have more that one system running node-red? If so then try that flow on another one.

0 Likes

#22

I'm out of ideas too. Probably something for @dceejay to maybe assist with.

0 Likes

#23

What if you set the x-axis to a strict number of points ? like 10.000 for instance. It sounds a lot like as if it reaches the maximum number of points within those 15 minutes. Not sure if 1000 is the default but it is is and you'd receive an update every second instead of the minute you expect.. you'd have 15 * 60 = 900 points in 15 minutes...

0 Likes

#24

Thanks guys, none of the suggestions seemed to make a difference.
What did was adding a flow to save the chart, now it is showing me the last 2 days but when I reboot I loose all of the data and have to start over again.
I set up the save according to this: https://www.hexamail.com/guides/node-red/persistcharts.htm
Here is the flow, it just needs a trigger if anybody cares to try it on their system.

[{"id":"e39bfe3a.9aa9c","type":"subflow","name":"SaveChart","info":"","category":"","in":[{"x":80,"y":60,"wires":[{"id":"65ee1ea9.e72d5"}]}],"out":[{"x":820,"y":80,"wires":[{"id":"1796804d.c4de2","port":0}]}]},{"id":"cfad2d3f.113aa","type":"file","z":"e39bfe3a.9aa9c","name":"","filename":"","appendNewline":true,"createDir":true,"overwriteFile":"true","x":690,"y":40,"wires":[[]]},{"id":"1726a911.e716f7","type":"file in","z":"e39bfe3a.9aa9c","name":"","filename":"","format":"utf8","sendError":true,"x":530,"y":80,"wires":[["1796804d.c4de2"]]},{"id":"26de0bfd.84e914","type":"json","z":"e39bfe3a.9aa9c","name":"","x":530,"y":40,"wires":[["cfad2d3f.113aa"]]},{"id":"1796804d.c4de2","type":"json","z":"e39bfe3a.9aa9c","name":"","x":690,"y":80,"wires":[[]]},{"id":"65ee1ea9.e72d5","type":"function","z":"e39bfe3a.9aa9c","name":"LoadSave","func":"var strSafe=msg.topic;\nif(strSafe)\n{\n strSafe=strSafe.replace(/[^a-z0-9]/gi, '_').toLowerCase();\n var loaded=context.get(strSafe)||0;\n msg.filename =\"/home/pi/charts/\"+strSafe+\".dat\";\n //node.warn(loaded);\n if(0===loaded)\n {\n //load chart!! \n msg.payload=\"load\";\n context.set(strSafe,1);\n \n //node.warn(\"Loading \" +strSafe);\n }\n else\n {\n //node.warn(\"Writing \" +strSafe);\n }\n return msg; \n}\nreturn null;\n\n","outputs":1,"noerr":0,"x":230,"y":60,"wires":[["996b23d6.8d9d"]]},{"id":"996b23d6.8d9d","type":"switch","z":"e39bfe3a.9aa9c","name":"Load data","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"","vt":"str"},{"t":"eq","v":"load","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":380,"y":60,"wires":[["26de0bfd.84e914"],["1726a911.e716f7"]]},{"id":"8d112433.654dd8","type":"ui_chart","z":"703220a0.a620a","name":"Temperature Chart","group":"f8030058.e1e44","order":3,"width":"8","height":"8","label":"Temperature","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"invalid data","dot":false,"ymin":"-5","ymax":"50","removeOlder":"4","removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":671.5000076293945,"y":189.7999930381775,"wires":[["170ec231.bff6de"],[]]},{"id":"829f1798.f7d1c8","type":"function","z":"703220a0.a620a","name":"Temperature","func":"msg.payload.value = msg.payload;\n\n\nreturn msg;","outputs":1,"noerr":0,"x":274.2142791748047,"y":190.71429443359375,"wires":[["9377859c.ac9998","e6a66c18.729e2"]]},{"id":"9377859c.ac9998","type":"aggregator","z":"703220a0.a620a","name":"","topic":"","intervalCount":1,"intervalUnits":"m","submitIncompleteInterval":true,"aggregationType":"mean","x":461.50240325927734,"y":185.47114753723145,"wires":[["bcae6e01.243be","8d112433.654dd8"]]},{"id":"170ec231.bff6de","type":"subflow:e39bfe3a.9aa9c","z":"703220a0.a620a","name":"","env":[],"x":892.5696563720703,"y":233.96393060684204,"wires":[["8d112433.654dd8"]]},{"id":"f8030058.e1e44","type":"ui_group","z":"","name":"Herons Greenhouse","tab":"2be2b3e4.c80b5c","disp":true,"width":"10","collapse":true},{"id":"2be2b3e4.c80b5c","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

Very frustrating.
Cheers,
Jon

0 Likes

#25

Have you read the blog post on the website about the changes in v0.19 about persistent context

0 Likes