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 (
|
||||
<AreaChart data={data} margin={{ top: 20, right: 80, left: 80, bottom: 5 }}>
|
||||
<CartesianGrid strokeDasharray="3 3" stroke="#374151" />
|
||||
@@ -370,30 +370,23 @@ const TransactionChart: React.FC<TransactionChartProps> = ({
|
||||
<Legend />
|
||||
<Area
|
||||
type="monotone"
|
||||
dataKey="cumulativeCosts"
|
||||
stroke="#EF4444"
|
||||
fill="#EF4444"
|
||||
dataKey="cumulativeProfit"
|
||||
stroke="#3B82F6"
|
||||
fill="#3B82F6"
|
||||
fillOpacity={0.3}
|
||||
name="Cumulative Costs"
|
||||
/>
|
||||
<Area
|
||||
type="monotone"
|
||||
dataKey="cumulativeRevenue"
|
||||
stroke="#10B981"
|
||||
fill="#10B981"
|
||||
fillOpacity={0.3}
|
||||
name="Cumulative Revenue"
|
||||
name="Cumulative Profit"
|
||||
/>
|
||||
<Line
|
||||
type="monotone"
|
||||
dataKey="profit"
|
||||
stroke="#3B82F6"
|
||||
stroke="#1E40AF"
|
||||
strokeWidth={2}
|
||||
name="Profit per Day"
|
||||
dot={false}
|
||||
/>
|
||||
</AreaChart>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user