diff --git a/docs/ensrainbow.io/src/components/molecules/BarChart.tsx b/docs/ensrainbow.io/src/components/molecules/BarChart.tsx index 318ba0f901..14592182fd 100644 --- a/docs/ensrainbow.io/src/components/molecules/BarChart.tsx +++ b/docs/ensrainbow.io/src/components/molecules/BarChart.tsx @@ -23,50 +23,38 @@ export default function BarChart({ data, title, subtitle, footnote }: BarChartPr {subtitle &&

{subtitle}

}
- {data.map((item: BarChartData, index: number) => ( - -
-
+ {data.map((item: BarChartData, index: number) => { + const percent = (item.value / maxValue) * 100; + const percentLabel = `${index === data.length - 1 ? "+" : ""}${percent}%`; + + return ( + +
{item.label} +
+
+
+
+ + {percentLabel} + +
-
-

- {index === data.length - 1 && "+"} - {(item.value / maxValue) * 100}% -

-
-
-
- {index < data.length - 1 &&
} - - ))} + {index < data.length - 1 &&
} + + ); + })}
{footnote &&

{footnote}

}