2016-05-24 07:01:16 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>Chart du sexe (HOMME/FEMME)</title>
|
|
|
|
<script type='text/javascript' src='/f/js/api-min/js/lib'></script> <!-- Gestion des transactions avec le serveur -->
|
2016-05-24 16:59:19 +00:00
|
|
|
<script type='text/javascript' src='/f/js/highcharts/highcharts'></script>
|
|
|
|
<script type='text/javascript' src='/f/js/exporting/highcharts/modules'></script>
|
2016-05-24 07:01:16 +00:00
|
|
|
</head>
|
|
|
|
<body style='display: flex; flex-direction: row; justify-content: space-around; flex-wrap: wrap;'>
|
|
|
|
|
2016-05-24 16:59:19 +00:00
|
|
|
<div id="age" style='margin: 2em'></div>
|
2016-05-24 07:01:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type='text/javascript'>
|
|
|
|
var api = new APIClass('/api/');
|
|
|
|
|
|
|
|
var age = document.getElementById('age');
|
|
|
|
|
|
|
|
/* [0] Paramètres globaux
|
|
|
|
=========================================================*/
|
|
|
|
|
|
|
|
subject = 273;
|
|
|
|
|
|
|
|
/* [1] On récupére les données SEXE
|
|
|
|
=========================================================*/
|
|
|
|
/* (1) On rédige la requête */
|
|
|
|
var request = {
|
2016-05-24 16:59:19 +00:00
|
|
|
path: 'chart/relations',
|
2016-05-24 07:01:16 +00:00
|
|
|
subject: subject
|
|
|
|
}
|
|
|
|
|
|
|
|
/* (2) On lance la requête */
|
|
|
|
api.send(request, function(response){
|
2016-05-24 16:59:19 +00:00
|
|
|
console.log( response );
|
2016-05-24 07:01:16 +00:00
|
|
|
|
|
|
|
/* (3) Si erreur, on quitte */
|
|
|
|
if( response.ModuleError != 0 )
|
|
|
|
return false;
|
|
|
|
|
2016-05-24 16:59:19 +00:00
|
|
|
/* (4) Gestion des paramètres */
|
|
|
|
var options = {
|
|
|
|
chart: { renderTo: age, defaultSeriesType: 'bar' },
|
|
|
|
series: response.series
|
|
|
|
};
|
2016-05-24 07:01:16 +00:00
|
|
|
|
|
|
|
|
2016-05-24 16:59:19 +00:00
|
|
|
/* (5) Création */
|
|
|
|
var chart = new Highcharts.Chart(options);
|
2016-05-24 07:01:16 +00:00
|
|
|
|
2016-05-24 16:59:19 +00:00
|
|
|
console.log(chart);
|
2016-05-24 07:01:16 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|