diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx index a076ca6..32ad739 100644 --- a/src/pages/Dashboard.tsx +++ b/src/pages/Dashboard.tsx @@ -54,7 +54,10 @@ const Dashboard = () => { const productsData = Object.keys(productSalesMap).map(key => ({ name: key, value: productSalesMap[key] - })).sort((a, b) => b.value - a.value).slice(0, 10); + })).sort((a, b) => b.value - a.value).slice(0, 10).map((item, index) => ({ + ...item, + fill: COLORS[index % COLORS.length] + })); return { totalRevenue: revenue, totalOrders: totalItems, averageOrderValue: revenue / (filteredData.length || 1), salesByProduct: productsData }; }, [filteredData]); @@ -112,18 +115,15 @@ const Dashboard = () => {