-
Notifications
You must be signed in to change notification settings - Fork 0
/
profapp.js
33 lines (31 loc) · 921 Bytes
/
profapp.js
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
const dummyData = {
points: 100,
badges: ["Inquisitive", "Solver"],
rank: 3,
contestRanks: [5, 2, 8, 4, 1],
};
document.getElementById("points").textContent = dummyData.points;
document.getElementById("badges").innerHTML = dummyData.badges.map(badge => <li>${badge}</li>).join("");
document.getElementById("rank").textContent = dummyData.rank;
const ctx = document.getElementById("contestGraph").getContext("2d");
const chart = new Chart(ctx, {
type: 'line',
data: {
labels: ['Contest 1', 'Contest 2', 'Contest 3', 'Contest 4', 'Contest 5'],
datasets: [{
label: 'Rank',
data: dummyData.contestRanks,
borderColor: '#9523d1',
borderWidth: 2,
fill: false,
}]
},
options: {
scales: {
y: {
beginAtZero: true,
reverse: true,
}
}
}
});