Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
O
oacc_portal_overview_cdc
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Le Filament
Opération Auto-Consommation Collective
oacc_portal_overview_cdc
Validations
963ad5fd
Valider
963ad5fd
rédigé
12 nov. 2023
par
Rémi - Le Filament
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[UPD] labels
parent
aba6b822
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
static/src/js/canvas.js
+31
-26
31 ajouts, 26 suppressions
static/src/js/canvas.js
templates/operation_templates_page.xml
+4
-4
4 ajouts, 4 suppressions
templates/operation_templates_page.xml
avec
35 ajouts
et
30 suppressions
static/src/js/canvas.js
+
31
−
26
Voir le fichier @
963ad5fd
...
...
@@ -37,10 +37,10 @@ odoo.define("oacc_portal_overview_cdc.canvas", function (require) {
// Init chart
this
.
chart_line_conso
=
null
;
this
.
chart_
donuts
_conso
=
null
;
this
.
chart_
pie
_conso
=
null
;
this
.
chart_histo_conso
=
null
;
this
.
chart_line_prod
=
null
;
this
.
chart_
donuts
_prod
=
null
;
this
.
chart_
pie
_prod
=
null
;
this
.
chart_histo_prod
=
null
;
this
.
date_range_picker
=
null
;
...
...
@@ -92,8 +92,8 @@ odoo.define("oacc_portal_overview_cdc.canvas", function (require) {
var
ctx_line_conso
=
self
.
$
(
"
.line_chart_conso
"
);
var
ctx_line_prod
=
self
.
$
(
"
.line_chart_prod
"
);
var
ctx_
donuts
_conso
=
self
.
$
(
"
.
donuts
_chart_conso
"
);
var
ctx_
donuts
_prod
=
self
.
$
(
"
.
donuts
_chart_prod
"
);
var
ctx_
pie
_conso
=
self
.
$
(
"
.
pie
_chart_conso
"
);
var
ctx_
pie
_prod
=
self
.
$
(
"
.
pie
_chart_prod
"
);
var
ctx_histo_conso
=
self
.
$
(
"
.histo_chart_conso
"
);
var
ctx_histo_prod
=
self
.
$
(
"
.histo_chart_prod
"
);
...
...
@@ -119,10 +119,10 @@ odoo.define("oacc_portal_overview_cdc.canvas", function (require) {
);
}
if
(
ctx_
donuts
_conso
.
length
>
0
)
{
self
.
chart_
donuts
_conso
=
new
Chart
(
ctx_
donuts
_conso
,
self
.
_get
Doughnut
ChartConfig
(
"
cons
"
)
if
(
ctx_
pie
_conso
.
length
>
0
)
{
self
.
chart_
pie
_conso
=
new
Chart
(
ctx_
pie
_conso
,
self
.
_get
Pie
ChartConfig
(
"
cons
"
)
);
}
...
...
@@ -140,10 +140,10 @@ odoo.define("oacc_portal_overview_cdc.canvas", function (require) {
);
}
if
(
ctx_
donuts
_prod
.
length
>
0
)
{
self
.
chart_
donuts
_prod
=
new
Chart
(
ctx_
donuts
_prod
,
self
.
_get
Doughnut
ChartConfig
(
"
prod
"
)
if
(
ctx_
pie
_prod
.
length
>
0
)
{
self
.
chart_
pie
_prod
=
new
Chart
(
ctx_
pie
_prod
,
self
.
_get
Pie
ChartConfig
(
"
prod
"
)
);
}
...
...
@@ -323,11 +323,11 @@ odoo.define("oacc_portal_overview_cdc.canvas", function (require) {
},
/**
* Returns a
Doughnut
chart configuration.
* Returns a
Pie
chart configuration.
*
* @private
*/
_get
Doughnut
ChartData
:
function
(
typeData
)
{
_get
Pie
ChartData
:
function
(
typeData
)
{
var
data
,
res
;
var
sum_res1
=
0
;
var
sum_res2
=
0
;
...
...
@@ -403,25 +403,30 @@ odoo.define("oacc_portal_overview_cdc.canvas", function (require) {
return
data
;
},
_get
Doughnut
ChartConfig
:
function
(
typeData
)
{
var
data
=
this
.
_get
Doughnut
ChartData
(
typeData
);
_get
Pie
ChartConfig
:
function
(
typeData
)
{
var
data
=
this
.
_get
Pie
ChartData
(
typeData
);
return
{
type
:
"
doughnut
"
,
type
:
"
pie
"
,
data
:
data
,
plugins
:
[
ChartDataLabels
],
options
:
{
cutoutPercentage
:
60
,
animation
:
{
animateScale
:
true
,
},
plugins
:
{
datalabels
:
{
color
:
"
white
"
,
font
:
{
size
:
20
,
weight
:
"
bold
"
,
},
padding
:
6
,
formatter
:
(
value
,
data
)
=>
{
var
total
=
0
;
data
.
dataset
.
data
.
forEach
((
num
)
=>
{
total
+=
num
;
});
var
labelPercentage
=
Math
.
round
((
value
/
total
)
*
100
);
return
value
+
"
kWh (
"
+
labelPercentage
+
"
%)
"
;
},
},
},
tooltips
:
{
...
...
@@ -639,9 +644,9 @@ odoo.define("oacc_portal_overview_cdc.canvas", function (require) {
self
.
chart_line_conso
.
update
();
}
if
(
self
.
chart_
donuts
_conso
!==
null
)
{
self
.
chart_
donuts
_conso
.
data
=
self
.
_get
Doughnut
ChartData
(
"
cons
"
);
self
.
chart_
donuts
_conso
.
update
();
if
(
self
.
chart_
pie
_conso
!==
null
)
{
self
.
chart_
pie
_conso
.
data
=
self
.
_get
Pie
ChartData
(
"
cons
"
);
self
.
chart_
pie
_conso
.
update
();
}
if
(
self
.
chart_histo_conso
!==
null
)
{
self
.
chart_histo_conso
.
data
=
self
.
_getBarChartData
(
"
cons
"
);
...
...
@@ -655,9 +660,9 @@ odoo.define("oacc_portal_overview_cdc.canvas", function (require) {
self
.
chart_line_prod
.
update
();
}
if
(
self
.
chart_
donuts
_prod
!==
null
)
{
self
.
chart_
donuts
_prod
.
data
=
self
.
_get
Doughnut
ChartData
(
"
prod
"
);
self
.
chart_
donuts
_prod
.
update
();
if
(
self
.
chart_
pie
_prod
!==
null
)
{
self
.
chart_
pie
_prod
.
data
=
self
.
_get
Pie
ChartData
(
"
prod
"
);
self
.
chart_
pie
_prod
.
update
();
}
if
(
self
.
chart_histo_prod
!==
null
)
{
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
templates/operation_templates_page.xml
+
4
−
4
Voir le fichier @
963ad5fd
...
...
@@ -262,8 +262,8 @@
<h3>
Bilan
</h3>
<br
/><br
/>
<canvas
id=
"
donuts
_chart_conso"
class=
"
donuts
_chart_conso"
id=
"
pie
_chart_conso"
class=
"
pie
_chart_conso"
width=
"auto"
height=
"200"
/>
...
...
@@ -303,8 +303,8 @@
<h3>
Bilan
</h3>
<br
/><br
/>
<canvas
id=
"
donuts
_chart_prod"
class=
"
donuts
_chart_prod"
id=
"
pie
_chart_prod"
class=
"
pie
_chart_prod"
width=
"auto"
height=
"200"
/>
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter