fix: tooltip formatter types in live page
This commit is contained in:
parent
8efa6ede32
commit
f8201b3d8e
@ -95,7 +95,7 @@ export default function LivePage() {
|
||||
<XAxis dataKey="time" tick={{ fill: "#94a3b8", fontSize: 10 }} tickLine={false} interval="preserveStartEnd" />
|
||||
<YAxis tick={{ fill: "#94a3b8", fontSize: 10 }} tickLine={false} axisLine={false}
|
||||
tickFormatter={v => `${v.toFixed(3)}%`} width={60} />
|
||||
<Tooltip formatter={(v: number) => [`${v.toFixed(5)}%`]}
|
||||
<Tooltip formatter={(v) => [`${Number(v).toFixed(5)}%`]}
|
||||
contentStyle={{ background: "#fff", border: "1px solid #e2e8f0", borderRadius: 8, fontSize: 12 }} />
|
||||
<Legend wrapperStyle={{ fontSize: 12 }} />
|
||||
<ReferenceLine y={0} stroke="#94a3b8" strokeDasharray="4 2" />
|
||||
@ -117,7 +117,7 @@ export default function LivePage() {
|
||||
tickFormatter={v => `$${(v/1000).toFixed(0)}k`} width={55} />
|
||||
<YAxis yAxisId="eth" orientation="right" tick={{ fill: "#7c3aed", fontSize: 10 }} tickLine={false} axisLine={false}
|
||||
tickFormatter={v => `$${v.toFixed(0)}`} width={55} />
|
||||
<Tooltip formatter={(v: number, name: string) => [name.includes("BTC") ? `$${v.toLocaleString()}` : `$${v.toFixed(2)}`, name]}
|
||||
<Tooltip formatter={(v, name) => [name?.toString().includes("BTC") ? `$${Number(v).toLocaleString()}` : `$${Number(v).toFixed(2)}`, name]}
|
||||
contentStyle={{ background: "#fff", border: "1px solid #e2e8f0", borderRadius: 8, fontSize: 12 }} />
|
||||
<Legend wrapperStyle={{ fontSize: 12 }} />
|
||||
<Line yAxisId="btc" type="monotone" dataKey="btcPrice" name="BTC价格" stroke="#2563eb" strokeWidth={1.5} dot={false} connectNulls />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user