-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
47 lines (38 loc) · 1.34 KB
/
index.html
File metadata and controls
47 lines (38 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html>
<head>
<title>tfdia.js Example</title>
</head>
<body onload="init()">
<h1>TFDia Example:</h1>
<div id="container">
<canvas width="400" height="400" id="dia" style="border: 1px solid black">
<p>Browsers that do not support the canvas element will show this text. Probably.</p>
</canvas><br>
</div>
<script src="tfdia.js"></script>
<script>
function init() {
var tfs = {};
for (var i=0; i<50; i++) {
var n = "tfd" + i;
var container = document.getElementById('container');
var newCanvas = document.createElement('canvas');
newCanvas.setAttribute('id', n);
newCanvas.setAttribute('width', 80);
newCanvas.setAttribute('height', 80);
container.appendChild(newCanvas);
}
for (var i=0; i<50; i++) {
var n = "tfd" + i;
tfs[n] = new TFDia(document.getElementById(n));
tfs[n].genTestData();
tfs[n].draw();
}
var tfd = new TFDia(document.getElementById('dia'));
tfd.genTestData();
tfd.draw();
}
</script>
</body>
</html>