Populate full dashboard chart

This example flow shows how to pass payload to various dashboard charts to populate full graphs with multiple data series.

This is not my flow, but I am using this every time I need to work on a new chart. I was unable to find the source, and I hope the owner has no issues of me re-posting it here.

[{"id":"a48dbabf.4f5808","type":"function","z":"daafb700.230458","name":"","func":"var m={};\nm.labels = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\"];\nm.series = ['Series A', 'Series B', 'Series C'];\nm.data = [\n    [65, 59, 80, 81, 56, 55, 40],\n    [28, 48, 40, 19, 86, 27, 90],\n    [38, 28, 20, 49, 45, 60, 20]\n  ];\nreturn {payload:[m]};","outputs":1,"noerr":0,"x":300,"y":375,"wires":[["650b4d79.f130c4","4a76f20d.8e4ddc","58ab75b.7e7d58c","90af7f6b.a9a9e"]]},{"id":"650b4d79.f130c4","type":"ui_chart","z":"daafb700.230458","name":"","group":"44d9222c.07961c","order":1,"width":0,"height":0,"label":"line chart","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"No Data","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":570,"y":115,"wires":[[]]},{"id":"e403a5c3.e8fe28","type":"function","z":"daafb700.230458","name":"","func":"var chart = [{\n    \"series\":[\"A\",\"B\",\"C\"],\n    \"data\":[[{\"x\":1504029632890,\"y\":5},{\"x\":1504029636001,\"y\":4},{\"x\":1504029638656,\"y\":2}],[{\"x\":1504029633514,\"y\":6},{\"x\":1504029636622,\"y\":7},{\"x\":1504029639539,\"y\":6}],[{\"x\":1504029634400,\"y\":7},{\"x\":1504029637959,\"y\":9},{\"x\":1504029640317,\"y\":7}]],\n    \"labels\":[\"\"]\n}];\nmsg.payload = chart;\n\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":215,"wires":[["650b4d79.f130c4"]]},{"id":"487b12db.06998c","type":"ui_button","z":"daafb700.230458","name":"","group":"afe97566.fbda58","order":1,"width":0,"height":0,"passthru":false,"label":"Time Line 1","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":160,"y":215,"wires":[["e403a5c3.e8fe28"]]},{"id":"4a76f20d.8e4ddc","type":"ui_chart","z":"daafb700.230458","name":"","group":"44d9222c.07961c","order":2,"width":0,"height":0,"label":"bar chart","chartType":"bar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"No Data","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":570,"y":175,"wires":[[],[]]},{"id":"20bdd016.7aed1","type":"ui_button","z":"daafb700.230458","name":"","group":"afe97566.fbda58","order":5,"width":0,"height":0,"passthru":false,"label":"array","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":140,"y":375,"wires":[["a48dbabf.4f5808"]]},{"id":"5083c707.fc7158","type":"random","z":"daafb700.230458","name":"","low":"1","high":"10000000","inte":"true","x":330,"y":575,"wires":[["650b4d79.f130c4"]]},{"id":"9dc648e5.2a4238","type":"inject","z":"daafb700.230458","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":160,"y":575,"wires":[["5083c707.fc7158"]]},{"id":"b0090ec8.78586","type":"function","z":"daafb700.230458","name":"","func":"var m={};\nm.labels = [10,20,30,40,50,60,70];\nm.series = ['Series A', 'Series B', 'Series C', 'Series D'];\nm.data = [\n    [65, 59, 80, 81, 56, 55, 40],\n    [28, 48, 40, 19, 86, 27, 90],\n    [38, 28, 20, 49, 45, 60, 20],\n    [58, 18, 40, 29, 15, 30, 60]\n  ];\nreturn {payload:[m]};","outputs":1,"noerr":0,"x":300,"y":415,"wires":[["650b4d79.f130c4","4a76f20d.8e4ddc","58ab75b.7e7d58c","90af7f6b.a9a9e"]]},{"id":"b20275c0.f96e88","type":"ui_button","z":"daafb700.230458","name":"","group":"afe97566.fbda58","order":6,"width":0,"height":0,"passthru":false,"label":"array2","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":140,"y":415,"wires":[["b0090ec8.78586"]]},{"id":"ab8c5bb0.4508e8","type":"function","z":"daafb700.230458","name":"","func":"var chart = [{\n    \"series\":[\"A\",\"B\",\"C\"],\n        \"data\":[[{\"x\":1,\"y\":5},{\"x\":2,\"y\":4},{\"x\":3,\"y\":2}],[{\"x\":4,\"y\":6},{\"x\":5,\"y\":7},{\"x\":6,\"y\":6}],[{\"x\":7,\"y\":7},{\"x\":8,\"y\":9},{\"x\":9,\"y\":7}]],\n    \"labels\":[\"\"]\n}];\nmsg.payload = chart;\n\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":255,"wires":[["650b4d79.f130c4"]]},{"id":"43f904d1.7a134c","type":"ui_button","z":"daafb700.230458","name":"","group":"afe97566.fbda58","order":2,"width":0,"height":0,"passthru":false,"label":"Time Line 2","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":160,"y":255,"wires":[["ab8c5bb0.4508e8"]]},{"id":"829fdc33.00756","type":"function","z":"daafb700.230458","name":"","func":"var m = {};\nm.labels = [\"Download\", \"In-Store\", \"Mail-Order\"];\nm.data = [[300, 500, 100]];\nm.series = [\"Sales\"];\nreturn {payload:[m],topic:msg.topic};","outputs":1,"noerr":0,"x":320,"y":615,"wires":[["90af7f6b.a9a9e","4a76f20d.8e4ddc","650b4d79.f130c4","ecc5d625.b10208","ad18c6bb.5616b8","58ab75b.7e7d58c"]]},{"id":"90af7f6b.a9a9e","type":"ui_chart","z":"daafb700.230458","name":"pie chart","group":"44d9222c.07961c","order":3,"width":0,"height":0,"label":"pie chart","chartType":"pie","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":"30","useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":610,"y":355,"wires":[[],[]]},{"id":"e3265c1e.a374","type":"ui_button","z":"daafb700.230458","name":"","group":"afe97566.fbda58","order":10,"width":0,"height":0,"passthru":false,"label":"array for pie","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"Pie 4 T","x":160,"y":615,"wires":[["829fdc33.00756"]]},{"id":"f8f677b.1576d88","type":"function","z":"daafb700.230458","name":"","func":"var chart = [{\n    \"series\":[\"A\",\"B\",\"C\"],\n        \"data\":[[{\"x\":1000000,\"y\":5},{\"x\":2000000,\"y\":4},{\"x\":3000000,\"y\":2}],[{\"x\":4000000,\"y\":6},{\"x\":5000000,\"y\":7},{\"x\":6000000,\"y\":6}],[{\"x\":7000000,\"y\":7},{\"x\":8000000,\"y\":9},{\"x\":9000000,\"y\":7}]],\n    \"labels\":[\"\"]\n}];\nmsg.payload = chart;\n\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":295,"wires":[["650b4d79.f130c4"]]},{"id":"f3e12c6.63e10d","type":"ui_button","z":"daafb700.230458","name":"","group":"afe97566.fbda58","order":3,"width":0,"height":0,"passthru":false,"label":"Time Line 3","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":160,"y":295,"wires":[["f8f677b.1576d88"]]},{"id":"42352d8a.c44564","type":"function","z":"daafb700.230458","name":"","func":"var chart = [{\n    \"series\":[\"A\",\"B\",\"C\"],\n        \"data\":[[{\"x\":1000000000,\"y\":5},{\"x\":2000000000,\"y\":4},{\"x\":3000000000,\"y\":2}],[{\"x\":4000000000,\"y\":6},{\"x\":5000000000,\"y\":7},{\"x\":6000000000,\"y\":6}],[{\"x\":7000000000,\"y\":7},{\"x\":8000000000,\"y\":9},{\"x\":9000000000,\"y\":7}]],\n    \"labels\":[\"\"]\n}];\nmsg.payload = chart;\n\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":335,"wires":[["650b4d79.f130c4"]]},{"id":"f6d9c377.8e3bf","type":"ui_button","z":"daafb700.230458","name":"","group":"afe97566.fbda58","order":4,"width":0,"height":0,"passthru":false,"label":"Time Line 4","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":160,"y":335,"wires":[["42352d8a.c44564"]]},{"id":"a9999623.3ecc08","type":"function","z":"daafb700.230458","name":"","func":"var m={\n    \"series\":[\"X\",\"Y\",\"Z\"],\n    \"data\":[[5,6,9],[3,8,5],[6,7,2]],\n    \"labels\":[\"Jan\",\"Feb\",\"Mar\"]\n};\nreturn {payload:[m]};","outputs":1,"noerr":0,"x":300,"y":535,"wires":[["650b4d79.f130c4","4a76f20d.8e4ddc","90af7f6b.a9a9e","ecc5d625.b10208","ad18c6bb.5616b8","58ab75b.7e7d58c"]]},{"id":"4acffbad.64b224","type":"ui_button","z":"daafb700.230458","name":"","group":"afe97566.fbda58","order":9,"width":0,"height":0,"passthru":false,"label":"array3c","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":150,"y":535,"wires":[["a9999623.3ecc08"]]},{"id":"24b7730c.4a578c","type":"ui_button","z":"daafb700.230458","name":"","group":"afe97566.fbda58","order":11,"width":0,"height":0,"passthru":false,"label":"array 2 for pie","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"Pie Hole","x":170,"y":655,"wires":[["fd0702c5.9feba"]]},{"id":"fd0702c5.9feba","type":"function","z":"daafb700.230458","name":"","func":"var m = {};\nm.labels = ['2006', '2007', '2008', '2009', '2010', '2011', '2012'];\nm.data = [[28, 48, 40, 19, 86, 27, 90]];\nm.series = ['Series A'];\nreturn {payload:[m],topic:msg.topic};","outputs":1,"noerr":0,"x":320,"y":655,"wires":[["90af7f6b.a9a9e","4a76f20d.8e4ddc","ad18c6bb.5616b8","ecc5d625.b10208","650b4d79.f130c4","58ab75b.7e7d58c"]]},{"id":"ea92c7ed.51ace8","type":"function","z":"daafb700.230458","name":"topic","func":"var m = [\n    {topic:\"X\", payload:22},\n    {topic:\"Y\", payload:66},\n    {topic:\"Z\", payload:42}\n    ];\nreturn [m];","outputs":1,"noerr":0,"x":300,"y":175,"wires":[["4a76f20d.8e4ddc","90af7f6b.a9a9e","650b4d79.f130c4","58ab75b.7e7d58c"]]},{"id":"520a6f12.347fd","type":"inject","z":"daafb700.230458","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":150,"y":175,"wires":[["ea92c7ed.51ace8"]]},{"id":"91c7e52e.e90908","type":"function","z":"daafb700.230458","name":"label","func":"var m = [\n    {label:\"A\", payload:22},\n    {label:\"B\", payload:66},\n    {label:\"C\", payload:42},\n    ];\nreturn [m];","outputs":1,"noerr":0,"x":300,"y":135,"wires":[["4a76f20d.8e4ddc","90af7f6b.a9a9e","650b4d79.f130c4","58ab75b.7e7d58c"]]},{"id":"16488b9e.ab8074","type":"inject","z":"daafb700.230458","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":150,"y":135,"wires":[["91c7e52e.e90908"]]},{"id":"f7c8e510.a97688","type":"function","z":"daafb700.230458","name":"","func":"var m={\n    \"series\":[\"X\",\"Y\",\"Z\"],\n    \"data\":[[5],[3],[6]],\n    \"labels\":[\"Jan\"]\n};\nreturn {payload:[m]};","outputs":1,"noerr":0,"x":300,"y":455,"wires":[["4a76f20d.8e4ddc","ecc5d625.b10208","ad18c6bb.5616b8","650b4d79.f130c4","58ab75b.7e7d58c","90af7f6b.a9a9e"]]},{"id":"75e26eee.82da2","type":"ui_button","z":"daafb700.230458","name":"","group":"afe97566.fbda58","order":7,"width":0,"height":0,"passthru":false,"label":"array3a","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":150,"y":455,"wires":[["f7c8e510.a97688"]]},{"id":"4f7a2070.17bf2","type":"function","z":"daafb700.230458","name":"","func":"var m={\n    \"series\":[\"X\"],\n    \"data\":[[5,3,6]],\n    \"labels\":[\"Jan\",\"Feb\",\"Mar\"]\n};\nreturn {payload:[m]};","outputs":1,"noerr":0,"x":300,"y":495,"wires":[["4a76f20d.8e4ddc","650b4d79.f130c4","ad18c6bb.5616b8","ecc5d625.b10208","58ab75b.7e7d58c","90af7f6b.a9a9e"]]},{"id":"259b3aa4.010d16","type":"ui_button","z":"daafb700.230458","name":"","group":"afe97566.fbda58","order":8,"width":0,"height":0,"passthru":false,"label":"array3b","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":150,"y":495,"wires":[["4f7a2070.17bf2"]]},{"id":"58ab75b.7e7d58c","type":"ui_chart","z":"daafb700.230458","name":"","group":"ef33233b.dd28f","order":2,"width":0,"height":0,"label":"horizontal bar","chartType":"horizontalBar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":"30","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":590,"y":235,"wires":[[],[]]},{"id":"ecc5d625.b10208","type":"ui_chart","z":"daafb700.230458","name":"","group":"ef33233b.dd28f","order":3,"width":0,"height":0,"label":"polar chart","chartType":"polar-area","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":"30","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":620,"y":475,"wires":[[],[]]},{"id":"ad18c6bb.5616b8","type":"ui_chart","z":"daafb700.230458","name":"","group":"ef33233b.dd28f","order":4,"width":0,"height":0,"label":"radar chart","chartType":"radar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":"30","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":2,"x":620,"y":535,"wires":[[],[]]},{"id":"549bbd5b.fb6494","type":"function","z":"daafb700.230458","name":"label","func":"var m = [\n    {label:\"A\", payload:22, series:\"X\"},\n    {label:\"B\", payload:66, series:\"X\"},\n    {label:\"C\", payload:42, series:\"X\"},\n    {label:\"A\", payload:33, series:\"Y\"},\n    {label:\"B\", payload:72, series:\"Y\"},\n    {label:\"C\", payload:12, series:\"Y\"},\n    {label:\"A\", payload:44, series:\"Z\"},\n    {label:\"B\", payload:32, series:\"Z\"},\n    {label:\"C\", payload:80, series:\"Z\"}\n    ];\nreturn [m];","outputs":1,"noerr":0,"x":300,"y":95,"wires":[["90af7f6b.a9a9e","4a76f20d.8e4ddc","650b4d79.f130c4","58ab75b.7e7d58c"]]},{"id":"b37cbbe5.9aa2e8","type":"inject","z":"daafb700.230458","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":150,"y":95,"wires":[["549bbd5b.fb6494"]]},{"id":"5c9d5603.ee6e78","type":"ui_button","z":"daafb700.230458","name":"","group":"afe97566.fbda58","order":11,"width":0,"height":0,"passthru":false,"label":"Clear All","color":"","bgcolor":"","icon":"","payload":"[]","payloadType":"json","topic":"","x":290,"y":55,"wires":[["ad18c6bb.5616b8","ecc5d625.b10208","90af7f6b.a9a9e","58ab75b.7e7d58c","4a76f20d.8e4ddc","650b4d79.f130c4"]]},{"id":"44d9222c.07961c","type":"ui_group","z":"","name":"Charts","tab":"f779dd92.cf698","order":2,"disp":false,"width":"6"},{"id":"afe97566.fbda58","type":"ui_group","z":"","name":"Inputs","tab":"f779dd92.cf698","order":1,"disp":false,"width":"6"},{"id":"ef33233b.dd28f","type":"ui_group","z":"","name":"Group 3","tab":"f779dd92.cf698","order":3,"disp":false,"width":"6"},{"id":"f779dd92.cf698","type":"ui_tab","z":"","name":"Charts","icon":"dashboard","order":2}]

Flow Info

Created 4 years, 8 months ago
Updated 4 years, 5 months ago
Rating: 5 2

Owner

Actions

Rate:

Node Types

Core
  • function (x14)
  • inject (x4)
Other
  • random (x1)
  • ui_button (x12)
  • ui_chart (x6)
  • ui_group (x3)
  • ui_tab (x1)

Tags

  • chart
  • dashboard
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option