From c7901587ca43c1082ab03c5705b547cdd0b4d04e Mon Sep 17 00:00:00 2001 From: jerem Date: Wed, 11 Dec 2024 16:47:40 +0100 Subject: [PATCH] #78 --- .../src/pages/atlas/charts/genders-histo.tsx | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/client/src/pages/atlas/charts/genders-histo.tsx b/client/src/pages/atlas/charts/genders-histo.tsx index 389ccc7e..4acfffe6 100644 --- a/client/src/pages/atlas/charts/genders-histo.tsx +++ b/client/src/pages/atlas/charts/genders-histo.tsx @@ -49,18 +49,26 @@ export default function GendersHistoChart({ { name: "FĂ©minin", data: data.map( - (item) => - (item.effectif_feminin * 100) / - (item.effectif_feminin + item.effectif_masculin) + (item) => + parseFloat( + ( + (item.effectif_feminin * 100) / + (item.effectif_feminin + item.effectif_masculin) + ).toFixed(1) + ) ), color: "#e18b76", }, { name: "Masculin", data: data.map( - (item) => - (item.effectif_masculin * 100) / - (item.effectif_feminin + item.effectif_masculin) + (item) => + parseFloat( + ( + (item.effectif_masculin * 100) / + (item.effectif_feminin + item.effectif_masculin) + ).toFixed(1) + ) ), color: "#efcb3a", }, @@ -121,7 +129,7 @@ export default function GendersHistoChart({ }, tooltip: { headerFormat: "{point.x}
", - pointFormat: "{series.name}: {point.y}
Total: {point.stackTotal}", + pointFormat: view === 'basic' ? "{series.name}: {point.y}
Total: {point.stackTotal}" : "{series.name}: {point.y}%", }, plotOptions: { column: {