debug percentage in report

This commit is contained in:
AmirHossein Mahmoodi
2024-02-17 14:22:26 +03:30
parent 35a24224fe
commit dcf7a68f5d

View File

@@ -25,7 +25,7 @@ const ReferredCharts = ({reportList}) => {
</Box>
<Grid container sx={{width: "100%"}}>
{innerObject.map((item, index) => {
let percentage = item.total_budget !== 0 ? item.total_amount / item.total_budget * 100 : 0;
let percentage = item.total_budget !== 0 ? item.total_amount / (item.total_budget) * 100 : 0;
return (
<Grid key={index} item xs={12} md={6} sx={{textAlign: "center"}}>
<Box>
@@ -40,12 +40,13 @@ const ReferredCharts = ({reportList}) => {
})}
</Typography>
</Box>
<RadialBarSemiCircularChart data={Math.round(percentage)}
formatter={(val) => `${val}%`}
label={t("reports.dynamic_label_referred", {
count: (item.count).toLocaleString("en"),
total_amount: (item.total_amount / 1000000).toLocaleString("en")
})}/>
<RadialBarSemiCircularChart
data={Math.round(percentage > 100 ? 100 : percentage)}
formatter={(val) => `${Math.round(percentage)}%`}
label={t("reports.dynamic_label_referred", {
count: (item.count).toLocaleString("en"),
total_amount: (item.total_amount / 1000000).toLocaleString("en")
})}/>
</Grid>
);
})}