Hey there,
I have a template node displaying a chart.js chart and it looks fine. I have a couple buttons in the template node calling functions that present different data points on the chart and the chart refreshes fine.
I also have javascript to watch the payload and assign it to a variable within the template node, and I have a function that sends the payload data to a debug node so I know the scope.watch is working.
(function(scope) {
scope.$watch('msg.payload', function(data) {
update(data);
});
})(scope);
function update(dta) {
theScope9.send({payload:dta});
var chartData3 = dta;
}
But I am still unable to dynamically update the chart with data in the payload. Any ideas? I must be missing something simple here..
Here is the flow:
[{"id":"a05bfcf4.f96d9","type":"inject","z":"89c71f4d.aee79","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":640,"wires":[["88536d7f.433cb"]]},{"id":"88536d7f.433cb","type":"function","z":"89c71f4d.aee79","name":"","func":"msg.payload = [2000, 3000, 4000, 5000, 4000, 3000, 2000]\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":640,"wires":[["c507efda.59ccf"]]},{"id":"c507efda.59ccf","type":"ui_template","z":"89c71f4d.aee79","group":"8fee23fd.be992","name":"","order":0,"width":"7","height":"6","format":"\n\n\n .container {\n width: 100%;\n height: 100%;\n }\n\n\n\n<button id="renderBtn1">\n Render\n\n
\n<button id="renderBtn2">\n Render\n\n
\n<button id="renderBtn3">\n Render\n\n
\n<div class="container">\n <canvas id="myChart">\n\n\n","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":440,"y":640,"wires":[["65803452.43a09c"]]},{"id":"65803452.43a09c","type":"debug","z":"89c71f4d.aee79","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":610,"y":640,"wires":},{"id":"8fee23fd.be992","type":"ui_group","z":"","name":"Macleans","tab":"30f5297.19ef7d6","disp":false,"width":"7","collapse":false},{"id":"30f5297.19ef7d6","type":"ui_tab","z":"","name":"Me","icon":"Remote Control","order":1,"disabled":false,"hidden":false}]