From bc72b7912cadb03de0028fbf256f702988d6dc80 Mon Sep 17 00:00:00 2001 From: Thibaut Valentin Date: Wed, 31 Dec 2025 14:50:15 +0100 Subject: [PATCH] fix: cat graphe color and text alignement --- src/main/webapp/src/pages/admin/StatsLazy.jsx | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/src/pages/admin/StatsLazy.jsx b/src/main/webapp/src/pages/admin/StatsLazy.jsx index 10507a7..1be603a 100644 --- a/src/main/webapp/src/pages/admin/StatsLazy.jsx +++ b/src/main/webapp/src/pages/admin/StatsLazy.jsx @@ -14,7 +14,7 @@ export default function StatsLazy({data}) {

Nombre de licences par catégorie pour {getSaison()}

-
+
@@ -60,7 +60,8 @@ function NbGraph({raw_data}) { - + } @@ -75,25 +76,25 @@ function CatGraph({raw_data}) { for (const k of raw_data.categories) { data.push({ name: k.name, - value: k.count, + value: k.count + 1, }) } setShowData(data) }, [raw_data]) - const COLORS = ['#33FF8F', '#30E393', '#2DC697', '#2AAA9B' - , '#278E9F', '#2471A3', '#2155A7', '#1E39AB' - , '#1B1CAF', '#1800B3']; + const COLORS = ['#ffff99', '#a6cee3', '#1f78b4', '#b2df8a' + , '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f' + , '#ff7f00', '#cab2d6', '#6a3d9a']; const RADIAN = Math.PI / 180; const renderCustomizedLabel = ({cx, cy, midAngle, innerRadius, outerRadius, index}) => { - const radius = innerRadius + (outerRadius - innerRadius) * 0.5; + const radius = innerRadius + (outerRadius - innerRadius) * 0.6; const x = cx + radius * Math.cos(-midAngle * RADIAN); const y = cy + radius * Math.sin(-midAngle * RADIAN); return <> { showData[index]['value'] > 0 && - cx ? 'start' : 'end'} dominantBaseline="central"> + {`${showData[index]['name']}`} @@ -159,9 +160,9 @@ function CatGraph({raw_data}) { onMouseEnter={onPieEnter}> {showData.map((entry, index) => ( - + ))} -} \ No newline at end of file +}