Hi,
I am new here and I have here a poject with sensor data´s what I display in a chart node. Thats work great but I display the data for one day as line chart and the week/month/year in a bar chart (data summery).
The default view is line chart and when i will change to bar I must press 2 times of the bar button to display the bar´s. Ok, that is not the problem. The workaround is I send 2 times the data information to the chart (node.send before return msg).
But the big problem is that i can not change back from bar to line. I see the line chart for milliseconds but than is the chart empty and I can display only the bar´s.
I have here a test flow to demonstrate the problem. I hope someone can me help. Big thanks.
[{"id":"fab6ba27.60d1e8","type":"ui_button","z":"2b13e84e.a17d5","name":"","group":"d3f45d80.19c25","order":1,"width":"4","height":"1","passthru":false,"label":"Line Chart","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"date","topic":"linechart","x":360,"y":120,"wires":[["672b743e.e8c374"]]},{"id":"ac4b0f8c.bf071","type":"ui_button","z":"2b13e84e.a17d5","name":"","group":"d3f45d80.19c25","order":2,"width":"4","height":"1","passthru":false,"label":"Bar Chart","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"date","topic":"barchart","x":350,"y":200,"wires":[["672b743e.e8c374"]]},{"id":"672b743e.e8c374","type":"function","z":"2b13e84e.a17d5","name":"","func":"var msg2 = {};\nvar chart = [];\n\nif (msg.topic === \"linechart\") {\n chart = [{\n \"series\": [\"A\", \"B\", \"C\"],\n \"data\": [\n [{ \"x\": 1504029632890, \"y\": 5 },\n { \"x\": 1504029636001, \"y\": 4 },\n { \"x\": 1504029638656, \"y\": 2 }\n ],\n [{ \"x\": 1504029633514, \"y\": 6 },\n { \"x\": 1504029636622, \"y\": 7 },\n { \"x\": 1504029639539, \"y\": 6 }\n ],\n [{ \"x\": 1504029634400, \"y\": 7 },\n { \"x\": 1504029637959, \"y\": 7 },\n { \"x\": 1504029640317, \"y\": 7 }\n ]\n ],\n \"labels\": [\"\"]\n }];\n msg2.payload = chart;\n msg2.ui_control = {\"look\": \"line\", \"legend\": false, \"interpolate\": \"linear\", \"xformat\": \"dd HH:mm\", \"colors\":['#FF0000', '#00FF00', '#0000FF', '#FFFF00', '#FF00FF', '#00FFFF', '#FFFFFF', '#000000', '#000000']};\n\n \n} else {\n chart = [{\n \"series\": [\"X\", \"Y\", \"Z\" ],\n \"data\": [ [5,6,9,10], [3,8,5,11], [6,7,2,12] ],\n \"labels\": [ \"Jan\", \"Feb\", \"Mar\", \"Apr\" ]\n }];\n msg2.payload = chart;\n msg2.ui_control = {\"look\": \"bar\", \"legend\": true, options: { scales: { xAxes: [{stacked: false}], yAxes: [{stacked: false}] } }, \"colors\":['#FF0000', '#00FF00', '#0000FF', '#FFFF00', '#FF00FF', '#00FFFF', '#FFFFFF', '#000000', '#000000']};\n}\n\nreturn msg2;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":180,"wires":[["85343536.a61a6","218f2c02.82c46c"]]},{"id":"85343536.a61a6","type":"ui_chart","z":"2b13e84e.a17d5","name":"","group":"d3f45d80.19c25","order":2,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":880,"y":180,"wires":[["a90ba68.e4029d8"]]},{"id":"a90ba68.e4029d8","type":"debug","z":"2b13e84e.a17d5","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1160,"y":180,"wires":[]},{"id":"218f2c02.82c46c","type":"debug","z":"2b13e84e.a17d5","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":880,"y":260,"wires":[]},{"id":"d3f45d80.19c25","type":"ui_group","name":"Group 1","tab":"2cec688c.1d16d","order":1,"disp":true,"width":"24","collapse":false},{"id":"2cec688c.1d16d","type":"ui_tab","name":"Test","icon":"dashboard","order":6,"disabled":false,"hidden":false}]