-
Notifications
You must be signed in to change notification settings - Fork 0
/
profapp.js
36 lines (34 loc) · 1.01 KB
/
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
34
35
36
// Dummy data for testing
const dummyData = {
points: 100,
badges: ["Inquisitive", "Solver"],
rank: 3,
contestRanks: [5, 2, 8, 4, 1],
};
// Update user profile with dummy data
document.getElementById("points").textContent = dummyData.points;
document.getElementById("badges").innerHTML = dummyData.badges.map(badge => <li>${badge}</li>).join("");
document.getElementById("rank").textContent = dummyData.rank;
// Create a line chart for contest ranks
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,
}
}
}
});