-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
54 lines (52 loc) · 1.55 KB
/
index.html
File metadata and controls
54 lines (52 loc) · 1.55 KB
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
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SOL Balance History</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.container {
width: 80%;
margin: 20px auto;
}
</style>
</head>
<body>
<div class="container">
<canvas id="balanceChart"></canvas>
</div>
<script>
async function renderChart() {
const response = await fetch('balance_data.json');
const balanceData = await response.json();
const ctx = document.getElementById('balanceChart').getContext('2d');
new Chart(ctx, {
type: 'line',
data: {
labels: balanceData.map(entry => entry.time),
datasets: [{
label: 'SOL Balance',
data: balanceData.map(entry => entry.balance),
borderColor: 'rgb(75, 192, 192)',
tension: 0.1
}]
},
options: {
responsive: true,
scales: {
y: {
beginAtZero: false,
title: {
display: true,
text: 'Balance (SOL)'
}
}
}
}
});
}
renderChart();
</script>
</body>
</html>