-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.html
93 lines (85 loc) · 2.75 KB
/
main.html
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!-- Give users the option to sign out -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://cdn.jsdelivr.net/npm/chart.js 'unsafe-eval';">
<title>Document</title>
<link href="./assets/css/main.css" rel="stylesheet" type="text/css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body>
<div class="container">
<span>Display</span>
</div>
<div>Bias graph</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<div>
<canvas id="myChart" width="400" height="400"></canvas>
</div>
<!-- This is the JS that is running the graph -->
<script>
// setup block
const data = {
datasets: [{
label: 'Users',
data: [{
x: 0,
y: 0,
}, {
x: 0,
y: 10,
}, {
x: 10,
y: 5,
}, {
x: 0.5,
y: 5.5,
}],
backgroundColor: 'rgb(255, 99, 132)'
}],
};
// config block
const config = {
type: 'bubble',
data: data,
options: {
title: {
display: true,
text: "Bias chart"
},
scales: {
yAxes: [{
beginAtZero: true,
scaleLabel: {
display: true,
labelString: 'Bias'
}
}],
xAxes: [{
scaleLabel: {
display: true,
labelString: "GDP (PPP)"
}
}]
}
}
};
// init render block
const myChart = new Chart(
document.getElementById('myChart'),
config
);
</script>
<div class="container">
<div class="center">
<button type="button" class="btn btn-primary btn-lg" id="check-article">Check another article</button>
</div>
<div class="center">
<button type="button" class="btn btn-primary btn-lg" id="sign_out">Sign out</button>
</div>
</div>
<script src="./main-script.js"></script>
</body>
</html>