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
|
<!DOCTYPE html>
<html>
<head><title>Graphique</title>
<SCRIPT LANGUAGE="JavaScript1.2" SRC="lib/graph.js"></SCRIPT>
<link rel="stylesheet" type="text/css" href="PageProf.css" media="screen" title="bbxcss" />
</head>
<?php
... Ici je récupère des données dans une bdd
echo '<body onload=histoS3("'.$nbP11.'","'.$nbP21.'","'.$nbP31.'","'.$nbAucunChoix.'")>';//Ici j'envoie les variables php à la fonction javascript ci dessous
echo '<div id="menu">
... Affichage du menu
</div>';
?>
<script type="text/javascript">
function histoS3(nbP11,nbP21,nbP31,nbAucunChoix) //fonction chargée de construire le graph
{
var i = new Graph(200,200);
i.title = "Choix de Parcours";
i.yLabel = "Effectif";
i.xLabel = "Parcours";
i.scale = 1;
i.relative = false;
i.setLegend("Choix 3","Choix 2","Choix 1","Sans choix");
i.addRow(nbP11,0,0,0);
i.addRow(0,nbP21,0,0);
i.addRow(0,0,nbP31,0);
i.addRow(0,0,0,nbAucunChoix);
i.build();
}
</SCRIPT>
</body>
</html> |