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

[UPD] replace bilan title on pie charts

parent 1fadd7c1
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -422,6 +422,14 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
_getPieChartConfig: function (typeData) {
var data = this._getPieChartData(typeData);
var tot = 0;
data.datasets[0].data.forEach((num) => {
tot += num;
});
var title = [
"Total : " + tot + " kWh",
"(sur la période sélectionnée)",
];
return {
type: "pie",
data: data,
......@@ -451,6 +459,14 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
},
},
},
title: {
display: true,
fontColor: "#000",
fontFamily: '"overpass", sans-serif',
fontSize: 24.5,
fontStyle: "normal",
text: title,
},
tooltips: {
callbacks: {
label: function (tooltipItem, chart) {
......@@ -654,7 +670,7 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
});
},
_exportChartData: function (title_name) {
_exportChartData: function () {
var self = this;
var url = "/chart/export_cdc?operation_id=" + self.operation;
url = url + "&start_date=" + self.first_day;
......@@ -761,8 +777,8 @@ odoo.define("oacc_portal_overview_cdc.operation_chart", function (require) {
this._updateChartData(this.title_name);
},
_onBtnExportClick: function (ev) {
this._exportChartData(this.title_name);
_onBtnExportClick: function () {
this._exportChartData();
},
_onChangePrm: function (ev) {
......
......@@ -198,7 +198,9 @@
class="col-10 col-xl-5 align-self-center mt-4 mt-lg-0"
t-if="partners"
>
<div class="prm-selection align-items-between justify-content-around d-flex">
<div
class="prm-selection align-items-between justify-content-around d-flex"
>
<select
class="form-select"
aria-label="prm-selection"
......@@ -248,7 +250,13 @@
</t>
</t>
</select>
<a href="#" title="Export" target="_blank" class="btn btn-primary" id="export-data" >
<a
href="#"
title="Export"
target="_blank"
class="btn btn-primary"
id="export-data"
>
<i class="fa fa-cloud-download " />
<span class="d-none d-md-inline">Exporter</span>
</a>
......@@ -277,13 +285,11 @@
<template id="bilan_conso">
<div class="text-center mb-4 p-3 shadow op-graph">
<h3>Bilan</h3>
<br /><br />
<div class="chart-container">
<canvas
id="pie_chart_conso"
class="pie_chart_conso"
height="140"
height="180"
/>
</div>
</div>
......@@ -322,13 +328,11 @@
<template id="bilan_prod">
<div class="text-center mb-4 p-3 shadow op-graph">
<h3>Bilan</h3>
<br /><br />
<div class="chart-container">
<canvas
id="pie_chart_prod"
class="pie_chart_prod"
height="140"
height="180"
/>
</div>
</div>
......
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