Ajoute le total en bas de chaque graph Charges structurelles par client
Ligne "Total" sous le graph principal et sous chacune des cartes par année -- somme calculée à partir des items déjà tracés (sumItems()), pas d'un champ stats séparé, pour rester cohérente par construction avec les barres affichées au-dessus.
This commit is contained in:
@@ -270,6 +270,14 @@
|
||||
typeColor(item) {
|
||||
return TYPE_COLORS[item.type] || '#6b7280';
|
||||
},
|
||||
// Sum of an hbar chart's own items -- for the "Total" line under
|
||||
// Charges structurelles par client (main chart and each per-année
|
||||
// card): those items are already whatever's actually plotted, so
|
||||
// summing them directly (rather than a separate stats field) keeps
|
||||
// the total consistent with the bars above it by construction.
|
||||
sumItems(items) {
|
||||
return items.reduce((sum, i) => sum + i.value, 0);
|
||||
},
|
||||
async load() {
|
||||
this.loading = true;
|
||||
this.error = null;
|
||||
|
||||
Reference in New Issue
Block a user