Line chart not working :'(

hello guys, recently i want to add line chart that read acceleration data into my dashboard which already consist of gauge..but its not working,sorry if its a basic question but i dont get it

the setting is as below

the dashboard

the data im sending is acceleration data ..is there anything that i missed? :frowning_face:

To show live data, the chart expects the input to be number. The debug node is not visible in your images thus it is only guess that all the dashboard widgets are connected directly to the node named SENSE. If the debug node shows that same output, then the output data is string. I can't understand how the gauges show something cos they also expect number. Such kind of output needs to be parsed to get value and axis info from it and then routed to correct dashboard widgets.

1 Like

the images is not showing full flow, i will share the flow below,,

[{"id":"fade33b0.31dc2","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"64915f5c.0a7238","type":"change","z":"fade33b0.31dc2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"X-AXIS,\" & $$.payload.`X-AXIS` & $moment().tz(\"Asia/Kuala_Lumpur\").format(\",DD/MM/YYYY,h:mm:ss a\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":280,"wires":[["55a1aba7.7cb53c","8258bfd2.d739a"]]},{"id":"85bcb7f0.7b1cc8","type":"change","z":"fade33b0.31dc2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"Y-AXIS,\" & $$.payload.`Y-AXIS` & $moment().tz(\"Asia/Kuala_Lumpur\").format(\",DD/MM/YYYY,h:mm:ss a\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":340,"wires":[["8258bfd2.d739a","a2609af6.5d05b"]]},{"id":"258a1d49.c7bce2","type":"change","z":"fade33b0.31dc2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"Z-AXIS,\" & $$.payload.`Z-AXIS` & $moment().tz(\"Asia/Kuala_Lumpur\").format(\",DD/MM/YYYY,h:mm:ss a\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":400,"wires":[["8258bfd2.d739a","90b1a43d.e74fa"]]},{"id":"8258bfd2.d739a","type":"debug","z":"fade33b0.31dc2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":220,"wires":[]},{"id":"55a1aba7.7cb53c","type":"file","z":"fade33b0.31dc2","name":"","filename":"C:\\Users\\User\\Desktop\\x-axis.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"utf8","x":860,"y":280,"wires":[[]]},{"id":"a2609af6.5d05b","type":"file","z":"fade33b0.31dc2","name":"","filename":"C:\\Users\\User\\Desktop\\y-axis.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"utf8","x":860,"y":340,"wires":[[]]},{"id":"90b1a43d.e74fa","type":"file","z":"fade33b0.31dc2","name":"","filename":"C:\\Users\\User\\Desktop\\z-axis.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"utf8","x":860,"y":400,"wires":[[]]},{"id":"3124b708.80021","type":"mqtt in","z":"fade33b0.31dc2","name":"","topic":"SENSE","qos":"0","datatype":"json","broker":"277379c9.ca83a6","nl":false,"rap":true,"rh":0,"x":130,"y":480,"wires":[["64915f5c.0a7238","85bcb7f0.7b1cc8","258a1d49.c7bce2","387d5149f767379c","e481df87a2125974","6e950eec79376623","ae635c5453e80a62","a479ab128864b4f8","a7bf2b6c6a65299c"]]},{"id":"387d5149f767379c","type":"ui_gauge","z":"fade33b0.31dc2","name":"","group":"c9187d66c3b99d19","order":1,"width":0,"height":0,"gtype":"gage","title":"X-AXIS","label":"units","format":"{{msg.payload[\"X-AXIS\"]}}","min":"-10","max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":460,"y":520,"wires":[]},{"id":"e481df87a2125974","type":"ui_gauge","z":"fade33b0.31dc2","name":"","group":"31b2f86b9e18b1bf","order":1,"width":0,"height":0,"gtype":"gage","title":"Y-AXIS","label":"units","format":"{{msg.payload[\"Y-AXIS\"]}}","min":"-10","max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":460,"y":580,"wires":[]},{"id":"6e950eec79376623","type":"ui_gauge","z":"fade33b0.31dc2","name":"","group":"cdaee5a1552bc622","order":0,"width":0,"height":0,"gtype":"gage","title":"Z-AXIS","label":"units","format":"{{msg.payload[\"Z-AXIS\"]}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":460,"y":640,"wires":[]},{"id":"ae635c5453e80a62","type":"ui_chart","z":"fade33b0.31dc2","name":"","group":"69208c23051d005e","order":0,"width":0,"height":0,"label":"X-AXIS","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"-10","ymax":"10","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":380,"y":720,"wires":[[]]},{"id":"a479ab128864b4f8","type":"ui_chart","z":"fade33b0.31dc2","name":"","group":"2ce3aeda268243c6","order":0,"width":0,"height":0,"label":"Y-AXIS ","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"-10","ymax":"10","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":380,"y":780,"wires":[[]]},{"id":"a7bf2b6c6a65299c","type":"ui_chart","z":"fade33b0.31dc2","name":"","group":"2ae5fc740265a6cd","order":0,"width":0,"height":0,"label":"Z-AXIS","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"-10","ymax":"10","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":380,"y":840,"wires":[[]]},{"id":"277379c9.ca83a6","type":"mqtt-broker","name":"","broker":"broker.hivemq.com","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"c9187d66c3b99d19","type":"ui_group","name":"X-AXIS ACCELERATION","tab":"5736cae9.f98874","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"31b2f86b9e18b1bf","type":"ui_group","name":"Y-AXIS ACCELERATION","tab":"5736cae9.f98874","order":2,"disp":true,"width":"6","collapse":false,"className":""},{"id":"cdaee5a1552bc622","type":"ui_group","name":"Z-AXIS ACCELERATION","tab":"5736cae9.f98874","order":3,"disp":true,"width":"6","collapse":false,"className":""},{"id":"69208c23051d005e","type":"ui_group","name":"X-AXIS LINECHART","tab":"5736cae9.f98874","order":4,"disp":true,"width":"6","collapse":false,"className":""},{"id":"2ce3aeda268243c6","type":"ui_group","name":"Y-AXIS LINECHART","tab":"5736cae9.f98874","order":5,"disp":true,"width":"6","collapse":false,"className":""},{"id":"2ae5fc740265a6cd","type":"ui_group","name":"Z-AXIS LINECHART","tab":"5736cae9.f98874","order":6,"disp":true,"width":"6","collapse":false,"className":""},{"id":"5736cae9.f98874","type":"ui_tab","name":"SENSE IT DASHBOARD","icon":"dashboard","disabled":false,"hidden":false}]

please have a look at it

According to gauge configuration you get the data from msg.payload.X-AXIS (and Y and Z)
So for chart you'll need to move that value to the msg.payload
Use change node for that.
Before each chart add one change node and configure accordingly

1 Like

The chart and gauge will accept a string if it can be parsed to a number.

The chart

Each input msg.payload value will be converted to a number. If the conversion fails, the message is ignored.

The gauge

The msg.payload is searched for a numeric value

1 Like

Thank you.
I'm well informed but that was not the case cos the debug showed definitely not acceptable string. Thus the flow was needed and that made things clear.

I tried it but not appearing

when i try this one, there is other value in debug and still not showing graph

did i place the node wrongly?

The first one should be correct.
Connect debug node directly to the SENSE node and show what is printed to the debug tab

it shows this

but chart still empty

Works fine for me

See the change node configuration
You may miss the dot between the payload and X-axis
must be msg.payload.X-AXIS

can u share the flow ? im doing the same thing here.. :frowning_face: :frowning_face:

i double check and its correct.

[{"id":"fade33b0.31dc2","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"64915f5c.0a7238","type":"change","z":"fade33b0.31dc2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"X-AXIS,\" & $$.payload.`X-AXIS` & $moment().tz(\"Asia/Kuala_Lumpur\").format(\",DD/MM/YYYY,h:mm:ss a\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":280,"wires":[["55a1aba7.7cb53c","8258bfd2.d739a"]]},{"id":"85bcb7f0.7b1cc8","type":"change","z":"fade33b0.31dc2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"Y-AXIS,\" & $$.payload.`Y-AXIS` & $moment().tz(\"Asia/Kuala_Lumpur\").format(\",DD/MM/YYYY,h:mm:ss a\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":340,"wires":[["8258bfd2.d739a","a2609af6.5d05b"]]},{"id":"258a1d49.c7bce2","type":"change","z":"fade33b0.31dc2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"Z-AXIS,\" & $$.payload.`Z-AXIS` & $moment().tz(\"Asia/Kuala_Lumpur\").format(\",DD/MM/YYYY,h:mm:ss a\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":400,"wires":[["8258bfd2.d739a","90b1a43d.e74fa"]]},{"id":"8258bfd2.d739a","type":"debug","z":"fade33b0.31dc2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":220,"wires":[]},{"id":"55a1aba7.7cb53c","type":"file","z":"fade33b0.31dc2","name":"","filename":"C:\\Users\\User\\Desktop\\x-axis.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"utf8","x":860,"y":280,"wires":[[]]},{"id":"a2609af6.5d05b","type":"file","z":"fade33b0.31dc2","name":"","filename":"C:\\Users\\User\\Desktop\\y-axis.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"utf8","x":860,"y":340,"wires":[[]]},{"id":"90b1a43d.e74fa","type":"file","z":"fade33b0.31dc2","name":"","filename":"C:\\Users\\User\\Desktop\\z-axis.csv","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"utf8","x":860,"y":400,"wires":[[]]},{"id":"3124b708.80021","type":"mqtt in","z":"fade33b0.31dc2","name":"","topic":"SENSE","qos":"0","datatype":"json","broker":"277379c9.ca83a6","nl":false,"rap":true,"rh":0,"x":130,"y":480,"wires":[["64915f5c.0a7238","85bcb7f0.7b1cc8","258a1d49.c7bce2","387d5149f767379c","e481df87a2125974","6e950eec79376623","3558e8ac8464fd37","dd91f4da10d131e0","689703588ca3ebef","8258bfd2.d739a"]]},{"id":"387d5149f767379c","type":"ui_gauge","z":"fade33b0.31dc2","name":"","group":"c9187d66c3b99d19","order":1,"width":0,"height":0,"gtype":"gage","title":"X-AXIS","label":"units","format":"{{msg.payload[\"X-AXIS\"]}}","min":"-10","max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":460,"y":520,"wires":[]},{"id":"e481df87a2125974","type":"ui_gauge","z":"fade33b0.31dc2","name":"","group":"31b2f86b9e18b1bf","order":1,"width":0,"height":0,"gtype":"gage","title":"Y-AXIS","label":"units","format":"{{msg.payload[\"Y-AXIS\"]}}","min":"-10","max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":460,"y":580,"wires":[]},{"id":"6e950eec79376623","type":"ui_gauge","z":"fade33b0.31dc2","name":"","group":"cdaee5a1552bc622","order":0,"width":0,"height":0,"gtype":"gage","title":"Z-AXIS","label":"units","format":"{{msg.payload[\"Z-AXIS\"]}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":460,"y":640,"wires":[]},{"id":"ae635c5453e80a62","type":"ui_chart","z":"fade33b0.31dc2","name":"","group":"69208c23051d005e","order":0,"width":0,"height":0,"label":"X-AXIS","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"-10","ymax":"10","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":660,"y":740,"wires":[[]]},{"id":"a479ab128864b4f8","type":"ui_chart","z":"fade33b0.31dc2","name":"","group":"2ce3aeda268243c6","order":0,"width":0,"height":0,"label":"Y-AXIS ","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"-10","ymax":"10","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":660,"y":800,"wires":[[]]},{"id":"a7bf2b6c6a65299c","type":"ui_chart","z":"fade33b0.31dc2","name":"","group":"2ae5fc740265a6cd","order":0,"width":0,"height":0,"label":"Z-AXIS","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"-10","ymax":"10","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":660,"y":860,"wires":[[]]},{"id":"3558e8ac8464fd37","type":"change","z":"fade33b0.31dc2","name":"move msg.payload X-AXIS","rules":[{"t":"set","p":"payload.X-AXIS","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":740,"wires":[["ae635c5453e80a62"]]},{"id":"dd91f4da10d131e0","type":"change","z":"fade33b0.31dc2","name":"move msg.payload Y-AXIS","rules":[{"t":"set","p":"payload.Y-AXIS","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":800,"wires":[["a479ab128864b4f8"]]},{"id":"689703588ca3ebef","type":"change","z":"fade33b0.31dc2","name":"move msg.payload Z-AXIS","rules":[{"t":"set","p":"payload.Z-AXIS","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":860,"wires":[["a7bf2b6c6a65299c"]]},{"id":"277379c9.ca83a6","type":"mqtt-broker","name":"","broker":"broker.hivemq.com","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"c9187d66c3b99d19","type":"ui_group","name":"X-AXIS ACCELERATION","tab":"5736cae9.f98874","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"31b2f86b9e18b1bf","type":"ui_group","name":"Y-AXIS ACCELERATION","tab":"5736cae9.f98874","order":2,"disp":true,"width":"6","collapse":false,"className":""},{"id":"cdaee5a1552bc622","type":"ui_group","name":"Z-AXIS ACCELERATION","tab":"5736cae9.f98874","order":3,"disp":true,"width":"6","collapse":false,"className":""},{"id":"69208c23051d005e","type":"ui_group","name":"X-AXIS LINECHART","tab":"5736cae9.f98874","order":4,"disp":true,"width":"6","collapse":false,"className":""},{"id":"2ce3aeda268243c6","type":"ui_group","name":"Y-AXIS LINECHART","tab":"5736cae9.f98874","order":5,"disp":true,"width":"6","collapse":false,"className":""},{"id":"2ae5fc740265a6cd","type":"ui_group","name":"Z-AXIS LINECHART","tab":"5736cae9.f98874","order":6,"disp":true,"width":"6","collapse":false,"className":""},{"id":"5736cae9.f98874","type":"ui_tab","name":"SENSE IT DASHBOARD","icon":"dashboard","disabled":false,"hidden":false}]

image
One mistake.
Change it to Move command

1 Like

yes its shows up..thanks man

1 Like

@puteramelaka Is that your live data that comes spewing out of broker.hivemq.com into my Node-Red without any password?

im sorry, what do u mean :sweat_smile: :sweat_smile:

but if its x,y and z acceleration probably yes,but its password protected unless u import the nodes that i posted in forum.

If you export nodes, it shouldn't copy any account details.
This seems to be working, the Username or Password fields are blank in the SENSE node.
But from time to time a burst of messages "X-AXIS": n etc were arriving in my Node-Red.
So I assume that your hivemq account is unprotected, perhaps you should check.

for testing purpose im using public hivemqqt broker...
i did set password and username ,,but yes u are true it still can connect with the use of the topic only

i will take note on this,thanks for sharing :smiley:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.