-
Notifications
You must be signed in to change notification settings - Fork 1
/
graphes.js
58 lines (48 loc) · 2.48 KB
/
graphes.js
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
function creerPie(nomCanvas, pourcentage_act_achevee, pourcentage_act_non_achevee){
// Pour ne pas avoir l'animation au chargement de la page.
var options = {
animation : false,
showTooltips: false,
};
var pieData = [
{label: "achevé", value: pourcentage_act_achevee, color: "#46BFBD"},
{value: pourcentage_act_non_achevee, color: "#E0E4CC"}];
var myPie = new Chart(document.getElementById(nomCanvas).getContext("2d")).Pie(pieData,options);
}
function creerPieDetaille(nomCanvas, pourcentage_act_achevee, pourcentage_act_non_achevee) {
var options = {
animation : false,// Pour ne pas avoir l'animation au chargement de la page.
showTooltips: false,
};
var pieData = [
{label: "achevé", value: pourcentage_act_achevee, color: "#36AFAD"},
{label: "non achevé", value: pourcentage_act_non_achevee, color: "#D8DCC4"}];
var myPie = new Chart(document.getElementById(nomCanvas).getContext("2d")).Pie(pieData,options);
}
function creerPieProf(nomCanvas, pourcentage_act_achevee, pourcentage_act_non_achevee) {
var options = {animation : false, showTooltips: false};
var pieData = [
{label: "achevé", value: pourcentage_act_achevee, color: "#0088CC"},
{label: "non achevé", value: pourcentage_act_non_achevee, color: "#E0E4CC"}];
var myPie = new Chart(document.getElementById(nomCanvas).getContext("2d")).Pie(pieData,options);
}
function creerDoughnut(nomCanvas, pourcentage_act_achevee, pourcentage_act_non_achevee) {
var options = {animation : false};
var doughnutData = [
{value: pourcentage_act_achevee, color: "#46BFBD"},
{value: pourcentage_act_non_achevee, color: "#E0E4CC"}];
var myDoughnut = new Chart(document.getElementById(nomCanvas).getContext("2d")).Doughnut(doughnutData,options);
}
function creerBar(nomCanvas, tableauHisto) {
var barChartData =
{ labels : ["0","10","20","30","40","50","60","70","80","90","100"],
datasets : [{fillColor: "rgba(151,187,205,0.5)",
strokeColor: "rgba(151,187,205,0.8)",
highlightFill: "rgba(151,187,205,0.75)",
highlightStroke: "rgba(151,187,205,1)",
data : tableauHisto }]};
var options = {
tooltipTemplate: "<%if (label){%> <%= value %> étudiant(s) sont à <%=label%>% du cours<%}%>",
}
var myLine = new Chart(document.getElementById(canvasHisto).getContext("2d")).Bar(barChartData, options);
}