03.11.2019, 10:26
(This post was last modified: 03.11.2019, 10:27 by Erwin van der Zwart.)
Hi,
Try this:
1) Create a html named canvas.html with this content
2) Upload canvas.html to the background images tab
3) Create a iframe and add source to: /scada/resources/img/canvas.html
4) Add this code to the custom JavaScript
BR,
Erwin
Try this:
1) Create a html named canvas.html with this content
Code:
<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas" width="100%" height="100%" style="border:1px solid #000000;"></canvas>
</body>
</html>
3) Create a iframe and add source to: /scada/resources/img/canvas.html
4) Add this code to the custom JavaScript
Code:
$(function(){
$( document ).ready(function() {
var f= $('iframe')
f.load(function(){
const cvs = f.contents().find('#myCanvas')
console.log(cvs);
const ctx = cvs[0].getContext("2d");
console.log(ctx);
ctx.moveTo(0,0);
ctx.lineTo(200,100);
ctx.stroke();
})
});
});
Erwin