[{"id":"70a2131.4af1aec","type":"ui_template","z":"66c8dbc5.4245b4","group":"9d7320e.521fce","name":"chart","order":1,"width":"24","height":"10","format":"\n\t<style>\n\t\thtml,body{\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n \theight:100%;\n\t\t}\n\t\tcanvas {\n\t\t\tbackground-color : #eee;\n\t\t\tposition: absolute;\n\t\t}\n\t\t</style>\n\t<body><canvas id=\"chartJSContainer\" style=\"height: 300px; width: 1011px; display: block;\" width=\"1011\" height=\"300\" class=\"chartjs-render-monitor\"></canvas>\n\t<script>\n\t\t\tvar options = {\n\t\t\t type: 'line',\n\t\t\t data: {\n\t\t\t labels: [\"00:00\", \"03:00\", \"06:00\", \"09:00\", \"12:00\", \"15:00\", \"18:00\", \"21:00\", \"24:00\"],\n datasets: [{\n label: \"Light cycle\",\n data: [12, 19, 3, 5, 12, 13, 3, 5, 12],\n backgroundColor: 'rgba(75, 192, 192, 0.2)',\n borderColor: \"#c0c0c0\",\n pointBorderColor: \"#00ccff\",\n pointBackgroundColor: \"#00ccff\",\n\t\t\t \tborderWidth: 1},\n\t\t\t\t\t\t]\n\t\t\t },\n\t\t\t options: {\n\t\t\t \tscales: {\n\t\t\t \tyAxes: [{\n\t\t\t ticks: {\n\t\t\t\t\treverse: false,\n\t\t\t\t\tmax: 25,\n min: 0\n\t\t\t }\n\t\t\t }]\n\t\t\t },\n\t\t\t\t\tdragData: true,\n\t\t\t\t\tdragX: false,\n\t\t\t\t\tonDragStart: function (e) {\n\t\t\t\t\t\tconsole.log(e)\n\t\t\t\t\t},\n\t\t\t\t\tonDrag: function (e, datasetIndex, index, value) {\n\t\t\t\t\t\tconsole.log(datasetIndex, index, value)\n\t\t\t\t\t},\n\t\t\t\t\tonDragEnd: function (e, datasetIndex, index, value) {\n\t\t\t\t\t\tconsole.log(datasetIndex, index, value)\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\n\t\t\tvar ctx = document.getElementById('chartJSContainer').getContext('2d');\n\t\t\twindow.test = new Chart(ctx, options);\n\t\t</script>\n<script src=\"https://cdn.jsdelivr.net/npm/chartjs-plugin-dragdata@0.2.1/dist/chartjs-plugin-dragData.min.js\"></script>\n\t\t\n\n</body></html>","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":638,"y":140,"wires":[["1b014fee.e549d"]]},{"id":"9d7320e.521fce","type":"ui_group","z":"","name":"Dynamic Light Control","tab":"385f5e22.9cd6f2","order":1,"disp":true,"width":"28","collapse":false},{"id":"385f5e22.9cd6f2","type":"ui_tab","z":"","name":"Day Cycle feeding","icon":"dashboard","order":7}]
trying to set up a draggable chart for controlling my lights, but having some trouble catching the functon from template node. have tried with external source and local source like import 'chartjs-plugin-dragdata'
JS is not my strongest trade, so if you could help me out abit i would be happi
thanks, best regards
Karl