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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
$(function () {
var url = link+"app/db/ref3x";
$.ajax({
url : url,
type : 'GET',
dataType : 'json', // On désire recevoir du HTML
success : function(code_json){ // code_html contient le HTML renvoyé
Highcharts.chart('ct_moy_pre_jo', {
chart: {
renderTo: 'ct_moy_pre_jo',
type: 'column'
},
title: {
text: 'Moyenne de présence par jour '
},
tooltip: {
formatter: function () {
return '' +
"" +
'Time: ' + Highcharts.dateFormat('%H:%M:%S', this.y);
}
},
plotOptions: {
column: {
dataLabels: {
rotation: -55,
enabled: true,
formatter: function () {
if (this.y === 0) {
return "";
}
else {
return Highcharts.dateFormat('%H:%M:%S', this.y);
}
}
}
}
},
yAxis: {
min: 0,
title: {
text: 'Moyenne (heure)',
align: 'high'
},
labels: {
overflow: 'justify',
formatter: function () {
var seconds = (this.value / 1000) | 0;
this.value -= seconds * 1000;
var minutes = (seconds / 60) | 0;
seconds -= minutes * 60;
var hours = (minutes / 60) | 0;
minutes -= hours * 60;
return hours;
}
}
},
dateFormat: { format: '%H:%M:%S' },
xAxis: {
categories: code_json[0]
},
series: [{
name: 'Présence',
data: code_json[1]
}]
});
}
});
}); |
Partager