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 = () => {
-
+

Produtos Mais Vendidos

-
+
- + } cursor={{ fill: '#222222' }} /> @@ -135,9 +135,17 @@ const Dashboard = () => {
+
+ {salesByProduct.map((entry, index) => ( +
+ + {entry.name} +
+ ))} +
-
+

Distribuição de Produtos

diff --git a/src/pages/ProductDetails.tsx b/src/pages/ProductDetails.tsx index 41ad920..29b482b 100644 --- a/src/pages/ProductDetails.tsx +++ b/src/pages/ProductDetails.tsx @@ -118,7 +118,7 @@ const ProductDetails = () => {

Volume de Vendas por Data

-
+