[page.home] {correction} maj des noms des heures + ajout de légendes extra
This commit is contained in:
parent
eaa2bc65e0
commit
c40d45e7c9
|
@ -33,7 +33,7 @@
|
||||||
:height="gstore.dimensions.bin.width"
|
:height="gstore.dimensions.bin.width"
|
||||||
:width="gstore.dimensions.bin.margin + (gstore.dimensions.axis.width * value)/gstore.maxValue"
|
:width="gstore.dimensions.bin.margin + (gstore.dimensions.axis.width * value)/gstore.maxValue"
|
||||||
:data-info="value">
|
:data-info="value">
|
||||||
<title>{{ value }}</title>
|
<title>{{ (gstore.titles && gstore.titles[key]) ? value + ' ' + gstore.titles[key] : value }}</title>
|
||||||
</rect>
|
</rect>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -14,30 +14,35 @@ api.call('GET department/stats', {}, function(rs) {
|
||||||
}
|
}
|
||||||
|
|
||||||
let maxValue = null;
|
let maxValue = null;
|
||||||
let maxKeyLength = null;
|
let maxLabelLength = null;
|
||||||
let data = {};
|
let data = {};
|
||||||
let map = {
|
let map = {
|
||||||
"potentiel" : "Heures dûes",
|
"potentiel" : "Heures potentielles",
|
||||||
"sous_service" : "Heures à faire",
|
"sous_service" : "Heures en sous-services",
|
||||||
"heures_comp" : "Heures comp.",
|
"heures_comp" : "Heures comp.",
|
||||||
"heures_vacataire" : "Heures vacataires",
|
"heures_vacataire" : "Heures vacataires",
|
||||||
"heures_exterieur" : "Heures extérieurs",
|
"heures_exterieur" : "Heures à l'extérieurs",
|
||||||
"heures_ue_desactive" : "Heures UE annulées",
|
"heures_ue_desactive" : "Heures UE annulées",
|
||||||
"nbr_ue_desactive" : "Nombre d'UE annulées"
|
"nbr_ue_desactive" : "Nombre d'UE annulées"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (let stat in rs.data) {
|
for (let stat in rs.data) {
|
||||||
maxValue = rs.data[stat] > maxValue ? rs.data[stat] : maxValue;
|
maxValue = rs.data[stat] > maxValue ? rs.data[stat] : maxValue;
|
||||||
maxKeyLength = stat.length > maxKeyLength ? stat.length : maxKeyLength;
|
maxLabelLength = map[stat].length > maxLabelLength ? map[stat].length : maxLabelLength;
|
||||||
|
|
||||||
data[map[stat]] = Math.round(rs.data[stat] * 100) / 100;
|
data[map[stat]] = Math.round(rs.data[stat] * 100) / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gstore.get.titles = {};
|
||||||
|
gstore.get.titles[map['heures_ue_desactive']] = `sur ${data[map['nbr_ue_desactive']]} UE annulées`;
|
||||||
|
|
||||||
|
delete data[map['nbr_ue_desactive']];
|
||||||
|
|
||||||
gstore.get.stats = data;
|
gstore.get.stats = data;
|
||||||
gstore.get.dimensions = {
|
gstore.get.dimensions = {
|
||||||
padding: 5,
|
padding: 5,
|
||||||
text: {
|
text: {
|
||||||
size: maxKeyLength * 9.5,
|
size: maxLabelLength * 9.5,
|
||||||
alignH: 5,
|
alignH: 5,
|
||||||
alignV: 20,
|
alignV: 20,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue