diff --git a/src/app/dashboard/sites/[id]/certificate-chart.tsx b/src/app/dashboard/sites/[id]/certificate-chart.tsx index d20d31d..720880c 100644 --- a/src/app/dashboard/sites/[id]/certificate-chart.tsx +++ b/src/app/dashboard/sites/[id]/certificate-chart.tsx @@ -47,16 +47,19 @@ export function buildCertificateSeries( const money = (value: number) => `R${formatNumber(value, { notation: "compact", maximumFractionDigits: 1 })}`; -export function CertificateChart({ points }: { points: CertificatePoint[] }) { +/** One figure per chart: monthly bars against the left axis, running total line against the right. */ +export function CertificateChart({ points, metric }: { points: CertificatePoint[]; metric: "certified" | "retention" }) { + const color = metric === "certified" ? CERTIFIED_COLOR : RETENTION_COLOR; + const label = metric === "certified" ? "Certified invoice" : "Retention"; return ( -
+
{points.length === 0 ? (
No certificates imported yet.
) : ( - + format(parseISO(`${value}-01`), "MMM yy")} stroke="var(--muted-foreground)" tickLine={false} axisLine={false} fontSize={11} minTickGap={16} /> @@ -71,10 +74,8 @@ export function CertificateChart({ points }: { points: CertificatePoint[] }) { labelFormatter={(value) => format(parseISO(`${String(value)}-01`), "MMMM yyyy")} formatter={(value: number) => formatCurrency(value)} /> {value}} /> - - - - + + )} diff --git a/src/app/dashboard/sites/[id]/site-detail-view.tsx b/src/app/dashboard/sites/[id]/site-detail-view.tsx index 15c3d12..6307b7c 100644 --- a/src/app/dashboard/sites/[id]/site-detail-view.tsx +++ b/src/app/dashboard/sites/[id]/site-detail-view.tsx @@ -627,18 +627,31 @@ export function SiteDetailView({ data }: { data: SiteDetailData }) { - {/* Certified invoice & retention, monthly and cumulative */} - - - Certified invoice & retention -

- Bars show each month; lines show the running total (right axis). Certified invoice incl VAT, retention ex VAT. -

-
- - - -
+ {/* Certified invoice and retention, each monthly and cumulative */} +
+ + + Certified invoice (VAT incl) +

+ Bars: each month (left axis) · line: running total (right axis). +

+
+ + + +
+ + + Retention (ex VAT) +

+ Bars: each month (left axis) · line: running total (right axis). +

+
+ + + +
+
{/* PO commitments */} {data.poList.length > 0 && (