refactor(ui): tokenize backtest dashboard charts

This commit is contained in:
root 2026-05-07 05:33:24 +00:00
parent d3443b0433
commit 9a0dfe6c4c

View File

@ -228,19 +228,19 @@ export const BacktestResultsDashboard: React.FC<BacktestResultsDashboardProps> =
<div style={{ width: '100%', height: 220 }}>
<ResponsiveContainer>
<LineChart data={equitySeries}>
<CartesianGrid stroke="#222" strokeDasharray="3 3" />
<CartesianGrid stroke="var(--bl-border-subtle)" strokeDasharray="3 3" />
<XAxis
dataKey="timestamp"
tickFormatter={(value) => new Date(Number(value)).toLocaleDateString()}
tick={{ fontSize: 10, fill: '#888' }}
tick={{ fontSize: 10, fill: 'var(--bl-text-faint)' }}
/>
<YAxis tick={{ fontSize: 10, fill: '#888' }} />
<YAxis tick={{ fontSize: 10, fill: 'var(--bl-text-faint)' }} />
<Tooltip
formatter={(value: any) => money(Number(value))}
labelFormatter={(label) => new Date(Number(label)).toLocaleString()}
/>
<ReferenceLine x={cursorTimestamp} stroke="#06b6d4" strokeWidth={1.5} strokeDasharray="4 4" />
<Line type="monotone" dataKey="equityUsd" stroke="#22c55e" strokeWidth={2} dot={false} />
<ReferenceLine x={cursorTimestamp} stroke="var(--bl-attention)" strokeWidth={1.5} strokeDasharray="4 4" />
<Line type="monotone" dataKey="equityUsd" stroke="var(--bl-success)" strokeWidth={2} dot={false} />
</LineChart>
</ResponsiveContainer>
</div>
@ -250,19 +250,19 @@ export const BacktestResultsDashboard: React.FC<BacktestResultsDashboardProps> =
<div style={{ width: '100%', height: 220 }}>
<ResponsiveContainer>
<LineChart data={equitySeries}>
<CartesianGrid stroke="#222" strokeDasharray="3 3" />
<CartesianGrid stroke="var(--bl-border-subtle)" strokeDasharray="3 3" />
<XAxis
dataKey="timestamp"
tickFormatter={(value) => new Date(Number(value)).toLocaleDateString()}
tick={{ fontSize: 10, fill: '#888' }}
tick={{ fontSize: 10, fill: 'var(--bl-text-faint)' }}
/>
<YAxis tick={{ fontSize: 10, fill: '#888' }} />
<YAxis tick={{ fontSize: 10, fill: 'var(--bl-text-faint)' }} />
<Tooltip
formatter={(value: any) => pct(Number(value))}
labelFormatter={(label) => new Date(Number(label)).toLocaleString()}
/>
<ReferenceLine x={cursorTimestamp} stroke="#06b6d4" strokeWidth={1.5} strokeDasharray="4 4" />
<Line type="monotone" dataKey="drawdownPct" stroke="#f97316" strokeWidth={2} dot={false} />
<ReferenceLine x={cursorTimestamp} stroke="var(--bl-attention)" strokeWidth={1.5} strokeDasharray="4 4" />
<Line type="monotone" dataKey="drawdownPct" stroke="var(--bl-warning)" strokeWidth={2} dot={false} />
</LineChart>
</ResponsiveContainer>
</div>