fix: tooltip formatter return type

This commit is contained in:
root 2026-02-26 12:48:09 +00:00
parent 0c170a6445
commit c972b8aab8

View File

@ -51,7 +51,7 @@ export default function HistoryPage() {
<LineChart data={chartData} margin={{ top: 4, right: 8, bottom: 4, left: 8 }}>
<XAxis dataKey="time" tick={{ fill: "#64748b", fontSize: 10 }} tickLine={false} interval="preserveStartEnd" />
<YAxis tick={{ fill: "#64748b", fontSize: 10 }} tickLine={false} axisLine={false} tickFormatter={(v) => `${v.toFixed(3)}%`} width={60} />
<Tooltip formatter={(v: unknown) => typeof v === "number" ? `${v.toFixed(4)}%` : v} contentStyle={{ background: "#1e293b", border: "1px solid #475569", borderRadius: 8 }} />
<Tooltip formatter={(v) => [`${Number(v).toFixed(4)}%`]} contentStyle={{ background: "#1e293b", border: "1px solid #475569", borderRadius: 8 }} />
<Legend wrapperStyle={{ fontSize: 12, color: "#94a3b8" }} />
<ReferenceLine y={0} stroke="#475569" strokeDasharray="4 2" />
<Line type="monotone" dataKey="BTC" stroke="#06b6d4" strokeWidth={1.5} dot={false} connectNulls />