Skip to content
Extraits de code Groupes Projets
Valider 4f61c1a7 rédigé par hugo's avatar hugo
Parcourir les fichiers

ajout graphique favoris

parent 4db77775
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -67,7 +67,10 @@ if (isset($_SESSION["authent"]) && $_SESSION['authent'] == 0){
</table>
<?php if ($compt2==1) echo "Pas de favoris <br/><br/><br/>"; ?>
</div>
</section>
<section class="one" style="background-color:#efefef;">
<div class="container">
<h2>Mes Favoris</h2>
<div class="divider"></div>
<table class="table">
......@@ -101,8 +104,51 @@ if (isset($_SESSION["authent"]) && $_SESSION['authent'] == 0){
</table>
</div>
</section>
<section class="one">
<div class="container">
<h2>Statistiques</h2>
<div class="divider"></div>
<div id="chartContainer" style="height: 370px; max-width: 920px; margin: 0px auto;"></div>
</div>
</section>
<script src="ressources/canvasjs/canvasjs.min.js"></script>
<script>
var influ = new Array();
<?php
$result2 = mysqli_query($link, "SELECT nom_artiste, nb_youtube + nb_instagram as nb, tag_instagram FROM influenceurs NATURAL JOIN favoris WHERE nb_youtube != 0 && nb_instagram != 0 && id_user = ".$_SESSION["id"]." ORDER BY nb DESC LIMIT 10");
while($row = mysqli_fetch_assoc($result2)) :?>
influ.push({y: <?= $row['nb'] ?>,label: '<?= $row['nom_artiste'] ?>'});
<?php endwhile; ?>
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer", {
backgroundColor: "transparent ",
theme: "theme2",
animationEnabled: true,
title:{
text: "Répartitions des 10 premier favoris"
},
legend:{
cursor: "pointer",
},
data: [{
type: "doughnut",
innerRadius: 90,
toolTipContent: "<b>{label}</b>: {y} foollowers (#percent%)",
dataPoints: influ,
}]
});
chart.options.data[0].dataPoints = influ;
chart.render();
}
</script>
<?php
include "footer.php"
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter