Create templates/registrations.html
Browse files- templates/registrations.html +42 -0
templates/registrations.html
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="ru">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Регистрации за сегодня</title>
|
7 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
8 |
+
</head>
|
9 |
+
<body>
|
10 |
+
<h1>Регистрации за сегодня по UTM-меткам</h1>
|
11 |
+
<canvas id="registrationsChart" width="400" height="200"></canvas>
|
12 |
+
<script>
|
13 |
+
// Запрос данных с сервера
|
14 |
+
fetch('/registrations_today')
|
15 |
+
.then(response => response.json())
|
16 |
+
.then(data => {
|
17 |
+
// Создание графика
|
18 |
+
const ctx = document.getElementById('registrationsChart').getContext('2d');
|
19 |
+
new Chart(ctx, {
|
20 |
+
type: 'bar',
|
21 |
+
data: {
|
22 |
+
labels: data.labels,
|
23 |
+
datasets: [{
|
24 |
+
label: 'Количество регистраций',
|
25 |
+
data: data.values,
|
26 |
+
backgroundColor: 'rgba(75, 192, 192, 0.2)',
|
27 |
+
borderColor: 'rgba(75, 192, 192, 1)',
|
28 |
+
borderWidth: 1
|
29 |
+
}]
|
30 |
+
},
|
31 |
+
options: {
|
32 |
+
scales: {
|
33 |
+
y: {
|
34 |
+
beginAtZero: true
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
});
|
39 |
+
});
|
40 |
+
</script>
|
41 |
+
</body>
|
42 |
+
</html>
|