Merge pull request 'features/graphique' (#1) from features/graphique into master
Reviewed-on: #1
This commit is contained in:
commit
d7bb3edcaa
2 changed files with 76 additions and 15 deletions
76
views/graphique.ejs
Normal file
76
views/graphique.ejs
Normal file
|
|
@ -0,0 +1,76 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Diagramme Radar avec Chart.js</title>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div style="width: 35%; margin: 0 auto;">
|
||||||
|
<canvas id="radarChart"></canvas>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const ctx = document.getElementById('radarChart').getContext('2d');
|
||||||
|
const radarChart = new Chart(ctx, {
|
||||||
|
type: 'radar',
|
||||||
|
data: {
|
||||||
|
labels: ['Qualité des plats', 'Ambiance', 'Accessibilité', 'Service', 'Tradition'],
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
label: 'Moyenne des notes',
|
||||||
|
data: [4.7, 4.6, 4.4, 4.3, 4.8],
|
||||||
|
fill: true,
|
||||||
|
backgroundColor: 'rgba(25, 80, 233, 0.2)',
|
||||||
|
borderColor: 'rgb(25, 80, 233, 10)',
|
||||||
|
pointBackgroundColor: 'rgb(55, 99, 132)',
|
||||||
|
pointBorderColor: '#fff',
|
||||||
|
pointHoverBackgroundColor: '#fff',
|
||||||
|
pointHoverBorderColor: 'rgb(255, 99, 132)',
|
||||||
|
pointStyle: 'circle',
|
||||||
|
pointRadius: 5,
|
||||||
|
pointRotation: 0,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
plugins: {
|
||||||
|
legend: {
|
||||||
|
display: false
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
callbacks: {
|
||||||
|
label: function(context) {
|
||||||
|
let label = context.dataset.label || '';
|
||||||
|
if (label) {
|
||||||
|
label += ': ';
|
||||||
|
}
|
||||||
|
label += context.formattedValue;
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
r: {
|
||||||
|
max: 5,
|
||||||
|
min: 0,
|
||||||
|
ticks: {
|
||||||
|
stepSize: 1,
|
||||||
|
callback: function(value, index, values) {
|
||||||
|
return value.toFixed(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
elements: {
|
||||||
|
line: {
|
||||||
|
borderWidth: 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Accueil</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<% if (user) { %>
|
|
||||||
<h1>Bienvenue, <%= user.username %>!</h1>
|
|
||||||
<a href="/logout">Déconnexion</a>
|
|
||||||
<% } else { %>
|
|
||||||
<h1>Bienvenue sur Resto-EPI</h1>
|
|
||||||
<a href="/auth/discord">Connexion/Inscription via Discord</a>
|
|
||||||
<% } %>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Loading…
Add table
Reference in a new issue