Improve store performance analytics with visible chart data

Update the Analytics page to correctly display store performance data in a bar chart by adjusting chart configurations, including data keys for axes, tooltips, and bar radii.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/P1V76jG
This commit is contained in:
michaelschal committed 2025-09-22 15:50:17 +00:00
1 parent c3150947a3
commit 42c5163dc2
2 files changed
+12 -6

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

+12 -6
View File
@@ -482,14 +482,20 @@ export default function Analytics() {
<CardContent>
{Array.isArray(byStore) && byStore.length > 0 ? (
<ResponsiveContainer width="100%" height={300}>
<BarChart data={byStore.slice(0, 5)} layout="horizontal">
<BarChart
data={byStore.slice(0, 5)}
margin={{ top: 20, right: 30, left: 20, bottom: 5 }}
>
<CartesianGrid strokeDasharray="3 3" />
<XAxis type="number" />
<YAxis dataKey="storeName" type="category" />
<Tooltip />
<XAxis dataKey="storeName" />
<YAxis />
<Tooltip
formatter={(value, name) => [value, name]}
labelFormatter={(label) => `Magasin : ${label}`}
/>
<Legend />
<Bar dataKey="orders" fill="#8884d8" name="Commandes" />
<Bar dataKey="deliveries" fill="#82ca9d" name="Livraisons" />
<Bar dataKey="orders" fill="#8884d8" name="Commandes" radius={[4, 4, 0, 0]} />
<Bar dataKey="deliveries" fill="#82ca9d" name="Livraisons" radius={[4, 4, 0, 0]} />
</BarChart>
</ResponsiveContainer>
) : (