-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
58 lines (44 loc) · 885 Bytes
/
index.html
File metadata and controls
58 lines (44 loc) · 885 Bytes
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
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.js"></script>
<body>
<canvas id="myChart" style="width:100%;max-width:600px"></canvas>
<script>
var xValues = [];
var yValues = [0,1];
var a = 1 *100;
var b = 1 *100;
var ab;
var c;
var percent = []
for (let i = 0; i <= 2000; i++) {
b+=1
ab= a+b
c = Math.sqrt((a*a)+(b*b))
if(i % 12.5 == 0){
percent.push(1-(c/ab))
xValues.push(i/100)
}
// console.log(c)
}
console.log(percent)
yValues = percent
new Chart("myChart", {
type: "line",
data: {
labels: xValues,
datasets: [{
fill: true,
lineTension: 0,
backgroundColor: "rgba(0,0,255,0)",
borderColor: "rgba(0,0,255,1)",
data: yValues,
}]
},
options: {
legend: {display: false},
}
});
</script>
</body>
</html>