Fix: Implement missing per-day lines in charts
The per-day lines were missing from the charts. This commit ensures that all charts display both cumulative and per-day data as requested.
This commit is contained in:
@@ -356,7 +356,7 @@ const TransactionChart: React.FC<TransactionChartProps> = ({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Profit chart - entire job view
|
if (type === 'profit') {
|
||||||
return (
|
return (
|
||||||
<AreaChart data={data} margin={{ top: 20, right: 80, left: 80, bottom: 5 }}>
|
<AreaChart data={data} margin={{ top: 20, right: 80, left: 80, bottom: 5 }}>
|
||||||
<CartesianGrid strokeDasharray="3 3" stroke="#374151" />
|
<CartesianGrid strokeDasharray="3 3" stroke="#374151" />
|
||||||
@@ -370,30 +370,23 @@ const TransactionChart: React.FC<TransactionChartProps> = ({
|
|||||||
<Legend />
|
<Legend />
|
||||||
<Area
|
<Area
|
||||||
type="monotone"
|
type="monotone"
|
||||||
dataKey="cumulativeCosts"
|
dataKey="cumulativeProfit"
|
||||||
stroke="#EF4444"
|
stroke="#3B82F6"
|
||||||
fill="#EF4444"
|
fill="#3B82F6"
|
||||||
fillOpacity={0.3}
|
fillOpacity={0.3}
|
||||||
name="Cumulative Costs"
|
name="Cumulative Profit"
|
||||||
/>
|
|
||||||
<Area
|
|
||||||
type="monotone"
|
|
||||||
dataKey="cumulativeRevenue"
|
|
||||||
stroke="#10B981"
|
|
||||||
fill="#10B981"
|
|
||||||
fillOpacity={0.3}
|
|
||||||
name="Cumulative Revenue"
|
|
||||||
/>
|
/>
|
||||||
<Line
|
<Line
|
||||||
type="monotone"
|
type="monotone"
|
||||||
dataKey="profit"
|
dataKey="profit"
|
||||||
stroke="#3B82F6"
|
stroke="#1E40AF"
|
||||||
strokeWidth={2}
|
strokeWidth={2}
|
||||||
name="Profit per Day"
|
name="Profit per Day"
|
||||||
dot={false}
|
dot={false}
|
||||||
/>
|
/>
|
||||||
</AreaChart>
|
</AreaChart>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user