This commit is contained in:
insvrgent
2025-02-03 14:38:18 +07:00
parent f6bc5dc401
commit 8676621fe2
3 changed files with 10 additions and 7 deletions

View File

@@ -165,10 +165,10 @@ const DailyCharts = ({ incomeGraph, transactionGraph, materialGraph, colors, typ
},
},
yaxis: {
show: false,
max: globalMax,
min: 0,
labels: {
maxWidth: 20,
style: {
colors: "transparent",
},

View File

@@ -105,7 +105,8 @@ if (aggregatedCurrentReports || aggregatedPreviousReports) {
}
}
},
yaxis: { show: false, max: globalMax, min: 0, labels: { style: { colors: "transparent" } } },
yaxis: { max: globalMax, min: 0, labels: {
maxWidth: 20, style: { colors: "transparent" } } },
grid: { show: false },
fill: { opacity: 0.5 },
colors: [colors[0]],
@@ -166,7 +167,7 @@ if (aggregatedCurrentReports || aggregatedPreviousReports) {
}
}
},
yaxis: { show: false, max: globalMax, min: 0, labels: { style: { colors: "transparent" } } },
yaxis: { max: globalMax, min: 0, labels: { maxWidth: 20, style: { colors: "transparent" } } },
grid: { show: false },
fill: { opacity: 0.5 },
colors: [colors[1]],

View File

@@ -173,7 +173,7 @@ const App = ({ forCafe = true, cafeId = -1,
const cafeTotal = (cafe.report?.itemSales || []).reduce((sum, item) => sum + item.sold, 0);
return total + cafeTotal;
}, 0);
console.log(totalSoldAcrossAllCafes)
const totalSpendAcrossAllCafes = filteredItems.reduce((total, cafe) => {
const cafeTotal = (cafe.report?.materialSpend || []).reduce((sum, item) => sum + item.spend, 0);
return total + cafeTotal;
@@ -484,11 +484,13 @@ const App = ({ forCafe = true, cafeId = -1,
invert={false}
loading={loading}
/>
{analytics?.itemSales &&
analytics?.itemSales.length > 0 && (
<h1>{segments[0]?.itemName}</h1>
{((analytics?.itemSales &&
analytics?.itemSales.length > 0) || (!analytics?.itemSales && segments.length > 0)) && (
<RoundedRectangle
title={"Item favorit"}
value={analytics?.itemSales[0]?.itemName}
value={analytics?.itemSales[0] != undefined ? analytics?.itemSales[0]?.itemName
: segments[0].itemName}
loading={loading}
/>
)}