Skip to content
Extraits de code Groupes Projets
Valider 6b639cf8 rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

[UPD] update title when reloading pie

parent 1fac7fb0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -685,6 +685,14 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
window.open(url, "_blank");
},
_updatePieChartTitle: function (data) {
var tot = 0;
data.datasets[0].data.forEach((num) => {
tot += num;
});
return ["Total : " + tot + " kWh", "(sur la période sélectionnée)"];
},
_updateDataTemplate: function (data) {
var self = this;
......@@ -733,6 +741,8 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
if (self.chart_pie_conso !== null) {
self.chart_pie_conso.data = self._getPieChartData("cons");
self.chart_pie_conso.options.title.text =
self._updatePieChartTitle(self.chart_pie_conso.data);
self.chart_pie_conso.update();
}
if (self.chart_histo_conso !== null) {
......@@ -751,6 +761,8 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
if (self.chart_pie_prod !== null) {
self.chart_pie_prod.data = self._getPieChartData("prod");
self.chart_pie_prod.options.title.text =
self._updatePieChartTitle(self.chart_pie_prod.data);
self.chart_pie_prod.update();
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter