Skip to content

Commit

Permalink
#78
Browse files Browse the repository at this point in the history
  • Loading branch information
jerem1508 committed Dec 11, 2024
1 parent e353b06 commit c790158
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions client/src/pages/atlas/charts/genders-histo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down Expand Up @@ -121,7 +129,7 @@ export default function GendersHistoChart({
},
tooltip: {
headerFormat: "<b>{point.x}</b><br/>",
pointFormat: "{series.name}: {point.y}<br/>Total: {point.stackTotal}",
pointFormat: view === 'basic' ? "{series.name}: {point.y}<br/>Total: {point.stackTotal}" : "{series.name}: {point.y}%",
},
plotOptions: {
column: {
Expand Down

0 comments on commit c790158

Please sign in to comment.