fix: tooltip formatter type
This commit is contained in:
parent
8bff7b19bd
commit
0c170a6445
@ -51,7 +51,7 @@ export default function HistoryPage() {
|
|||||||
<LineChart data={chartData} margin={{ top: 4, right: 8, bottom: 4, left: 8 }}>
|
<LineChart data={chartData} margin={{ top: 4, right: 8, bottom: 4, left: 8 }}>
|
||||||
<XAxis dataKey="time" tick={{ fill: "#64748b", fontSize: 10 }} tickLine={false} interval="preserveStartEnd" />
|
<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} />
|
<YAxis tick={{ fill: "#64748b", fontSize: 10 }} tickLine={false} axisLine={false} tickFormatter={(v) => `${v.toFixed(3)}%`} width={60} />
|
||||||
<Tooltip formatter={(v: number) => `${v.toFixed(4)}%`} contentStyle={{ background: "#1e293b", border: "1px solid #475569", borderRadius: 8 }} />
|
<Tooltip formatter={(v: unknown) => typeof v === "number" ? `${v.toFixed(4)}%` : v} contentStyle={{ background: "#1e293b", border: "1px solid #475569", borderRadius: 8 }} />
|
||||||
<Legend wrapperStyle={{ fontSize: 12, color: "#94a3b8" }} />
|
<Legend wrapperStyle={{ fontSize: 12, color: "#94a3b8" }} />
|
||||||
<ReferenceLine y={0} stroke="#475569" strokeDasharray="4 2" />
|
<ReferenceLine y={0} stroke="#475569" strokeDasharray="4 2" />
|
||||||
<Line type="monotone" dataKey="BTC" stroke="#06b6d4" strokeWidth={1.5} dot={false} connectNulls />
|
<Line type="monotone" dataKey="BTC" stroke="#06b6d4" strokeWidth={1.5} dot={false} connectNulls />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user