Skip to content

Commit c2734be

Browse files
committed
add spam-report.html (another graph that looks pretty good- need opinion about which one to choose )
1 parent 239ec83 commit c2734be

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

views/spam-report.html

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Spam Report</title>
6+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
7+
</head>
8+
<body style="width: 60vw; height: 60vh; display: flex; align-items: center; justify-content: center; margin: auto;margin-top: 150px;">
9+
<canvas id="spamChart" width="400" height="200"></canvas>
10+
<script>
11+
fetch('../statsData/spam-report.json')
12+
.then(response => response.json())
13+
.then(data => {
14+
const labels = data.map(entry => entry.date);
15+
const spamIssues = data.map(entry => entry.totalSpamIssues);
16+
const spamPRs = data.map(entry => entry.totalSpamPRs);
17+
18+
const ctx = document.getElementById('spamChart').getContext('2d');
19+
new Chart(ctx, {
20+
type: 'line',
21+
data: {
22+
labels: labels,
23+
datasets: [
24+
{
25+
label: 'Spam Issues',
26+
data: spamIssues,
27+
borderColor: 'rgba(255, 99, 132, 1)',
28+
borderWidth: 1
29+
},
30+
{
31+
label: 'Spam PRs',
32+
data: spamPRs,
33+
borderColor: 'rgba(54, 162, 235, 1)',
34+
borderWidth: 1
35+
}
36+
]
37+
},
38+
options: {
39+
scales: {
40+
y: {
41+
beginAtZero: true
42+
}
43+
}
44+
}
45+
});
46+
});
47+
</script>
48+
</body>
49+
</html>

0 commit comments

Comments
 (0)