NxTIC/test-charts/all.php

61 lines
1.4 KiB
PHP

<!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 -->
<script type='text/javascript' src='/f/js/highcharts/highcharts'></script>
<script type='text/javascript' src='/f/js/exporting/highcharts/modules'></script>
</head>
<body style='display: flex; flex-direction: row; justify-content: space-around; flex-wrap: wrap;'>
<div id="age" style='margin: 2em'></div>
<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 = {
path: 'chart/relations',
subject: subject
}
/* (2) On lance la requête */
api.send(request, function(response){
console.log( response );
/* (3) Si erreur, on quitte */
if( response.ModuleError != 0 )
return false;
/* (4) Gestion des paramètres */
var options = {
chart: { renderTo: age, defaultSeriesType: 'bar' },
series: response.series
};
/* (5) Création */
var chart = new Highcharts.Chart(options);
console.log(chart);
});
</script>
</body>
</html>