node-red dashboard bar chart

1,326 views
Skip to first unread message

Iura Boncalo

unread,
Feb 24, 2017, 10:05:14 AM2/24/17
to Node-RED
Hi,

Can somebody help me in correctly adding values in the bar chart object.
I'm passing this object:
var msg = { topic : 'C', payload : 150 }
return msg;
But I'm encountering the following error:
msg : error
"TypeError: data[0].values.data[i].map is not a function"
What am I doing wrong?

Thanks.


Colin Law

unread,
Feb 24, 2017, 10:23:30 AM2/24/17
to node...@googlegroups.com
Can you post enough of your flow to see the problem please?
Export it by selecting the nodes, and then from the hamburger menu
Export > Clipboard and paste it here.

Colin
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/bc5baa5d-0fbd-49a4-90ce-eea10cfcdc2c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Iura Boncalo

unread,
Feb 25, 2017, 4:38:13 PM2/25/17
to Node-RED
[{"id":"312e5292.771c0e","type":"ui_chart","z":"b3bb822a.479888","name":"","group":"e65a6264.b4a8f","order":0,"width":0,"height":0,"label":"chart","chartType":"horizontalBar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":910,"y":460,"wires":[["22c462e5.5b961e"],["f9ab157a.89f148"]]},{"id":"4775a3c3.1cd03c","type":"inject","z":"b3bb822a.479888","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":600,"y":460,"wires":[["7baeca4.8450334"]]},{"id":"22c462e5.5b961e","type":"debug","z":"b3bb822a.479888","name":"","active":true,"console":"false","complete":"false","x":1090,"y":440,"wires":[]},{"id":"f9ab157a.89f148","type":"debug","z":"b3bb822a.479888","name":"","active":true,"console":"false","complete":"false","x":1090,"y":480,"wires":[]},{"id":"7baeca4.8450334","type":"function","z":"b3bb822a.479888","name":"","func":"var msg = { topic : 'C', payload : 150 };\nreturn msg;","outputs":1,"noerr":0,"x":750,"y":460,"wires":[["312e5292.771c0e"]]},{"id":"e65a6264.b4a8f","type":"ui_group","z":"","name":"Unicredit","tab":"8f192c0e.3ce7f","order":1,"disp":true,"width":"10"},{"id":"8f192c0e.3ce7f","type":"ui_tab","z":"","name":"Bank","icon":"account_balance_wallet","order":2}]

A simple flow for chart (bar) node. 

Mark Setrem

unread,
Feb 25, 2017, 4:54:05 PM2/25/17
to Node-RED
What version of the dashboard are you using?

Colin Law

unread,
Feb 25, 2017, 5:09:58 PM2/25/17
to node...@googlegroups.com
I am seeing the error too, with node-red 0.16.2, node.js 4.8.0 and
dashboard 2.2.1
However the bar chart does work even though the error appears.
To see two bars replace the function with

var msg1 = { topic : 'C', payload : 150 };
node.send(msg1);
var msg2 = { topic : 'D', payload : 100 };
return msg2;

Colin
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/b8250579-52bb-46f2-9c97-a99a81cf36a4%40googlegroups.com.

Dave C-J

unread,
Feb 25, 2017, 6:01:45 PM2/25/17
to node...@googlegroups.com
Colin,
yup there is a bug on the data output in bar chart mode - raised as issue #181
Reply all
Reply to author
Forward
Message has been deleted
0 new messages