diff --git a/client/src/pages/TimePage.tsx b/client/src/pages/TimePage.tsx index e9f7cbe..98243a7 100644 --- a/client/src/pages/TimePage.tsx +++ b/client/src/pages/TimePage.tsx @@ -69,6 +69,11 @@ export function TimePage() { ? hourlyRows.reduce((best: any, r: any) => Number(r.bill_count || 0) > Number(best?.bill_count || 0) ? r : best, null) : null + const maxBillCount = hourlyRows.length > 0 ? Math.max(...hourlyRows.map((r: any) => Number(r.bill_count || 0))) : 0 + const maxReceived = hourlyRows.length > 0 ? Math.max(...hourlyRows.map((r: any) => Number(r.received || 0))) : 0 + const yLeftMax = Math.ceil(maxReceived * 1.15 / 10000) * 10000 + const yRightMax = Math.ceil(maxBillCount * 1.15 / 10000) * 10000 + const channelTotals = channelRows.length > 0 ? Object.keys(channelRows[0]).filter(k => k !== 'business_date' && k !== 'meituan_commission' && k !== 'taobao_commission' && k !== 'jd_commission') .map(k => ({ @@ -123,8 +128,8 @@ export function TimePage() { `${v}:00`} tick={{ fontSize: 10 }} /> - v >= 10000 ? `${(v / 10000).toFixed(0)}万` : v} tick={{ fontSize: 10 }} domain={[0, (max: number) => Math.ceil(max * 1.15 / 10000) * 10000]} /> - v >= 10000 ? `${(v / 10000).toFixed(0)}万` : v} tick={{ fontSize: 10 }} domain={[0, (max: number) => Math.ceil(max * 1.15 / 10000) * 10000]} /> + v >= 10000 ? `${(v / 10000).toFixed(0)}万` : v} tick={{ fontSize: 10 }} domain={[0, yLeftMax]} /> + v >= 10000 ? `${(v / 10000).toFixed(0)}万` : v} tick={{ fontSize: 10 }} domain={[0, yRightMax]} /> `${v}:00`} formatter={(v: any, name: any) => name === '实收' ? formatCurrency(v) : formatNumber(v)} />