Charts in node-red-dashboard, with contol of x-axis
6,718 views
Skip to first unread message
Charles Palmer
unread,
Feb 12, 2017, 4:42:33 PM2/12/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Node-RED
How can I make node-red-dashboard charts with an X-axis of my choice? (e.g. send (x,y)
pairs? It seems that the -dashboard charts are restricted to time of the
event as the x-axis. Could I use the template and place some other
chart inside? Example, please.
Dave C-J
unread,
Feb 12, 2017, 4:50:31 PM2/12/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to node...@googlegroups.com
yes to both approaches. If you send a single point it is assumed to be time based. You can instead send a complete array of points - this is usually used to preload / reload the graph... but can be used to do and x/y plot instead.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Node-RED
As far as I can see, both the node-red-dashboard chart and Colin's code support ONLY time for the X-axis. Is that right? I guess Colin's code provides a more accessible starting point for modification: I have used his "load" action to draw a graph with an array where the x values are Date objects, but failed (so far) where x values are integers. Any suggestions or examples appreciated.
Colin Law
unread,
Feb 13, 2017, 8:25:51 AM2/13/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to node...@googlegroups.com
There is nothing in my method that forces the x axis to be time. Make
sure you have not left the x axis specification in the chart structure
as time. So you don't want
options: {
scales: {
xAxes: [{
type: 'time',
If you cannot get it going post a simple flow here showing the problem.
Colin
On 13 February 2017 at 12:31, 'Charles Palmer' via Node-RED
Yes, one thing to do is to is to change the xAxes definition to: xAxes: [{ type: 'linear', position: 'bottom' } ], Then you can send the chart.js template the data object with msg.action = "load".
Thanks Colin. You might consider if your Node-red Library example would be enhanced by adding my example. - Charles
Colin Law
unread,
Feb 13, 2017, 11:03:57 AM2/13/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to node...@googlegroups.com
Hi Charles
Add your example to the library and then people should find both if
they look for it. If you reference mine on yours I will then ref yours
on mine.
Cheers
Colin
On 13 February 2017 at 14:50, 'Charles Palmer' via Node-RED