fix: remove explicit type annotations on Recharts formatter callbacks
TypeScript strict mode in CI rejects explicit parameter types on Recharts formatter/tickFormatter callbacks. Use inference with 'as number' casts on the value instead. Also fix unsafe cast in PortfolioComposition and handle possibly-undefined percent.
This commit is contained in:
@@ -50,7 +50,7 @@ export function PerformanceCharts() {
|
||||
<Tooltip
|
||||
contentStyle={tooltipStyle}
|
||||
labelStyle={{ color: '#9ca3af' }}
|
||||
formatter={(value: number) => [`${value.toFixed(2)}%`, 'Cumulative Return']}
|
||||
formatter={(value) => [`${Number(value).toFixed(2)}%`, 'Cumulative Return']}
|
||||
/>
|
||||
<Line
|
||||
type="monotone"
|
||||
@@ -75,7 +75,7 @@ export function PerformanceCharts() {
|
||||
<Tooltip
|
||||
contentStyle={tooltipStyle}
|
||||
labelStyle={{ color: '#9ca3af' }}
|
||||
formatter={(value: number) => [`${value.toFixed(2)}%`, 'Daily Return']}
|
||||
formatter={(value) => [`${Number(value).toFixed(2)}%`, 'Daily Return']}
|
||||
/>
|
||||
<Bar dataKey="dailyReturn" name="Daily Return">
|
||||
{chartData.map((entry, i) => (
|
||||
@@ -97,7 +97,7 @@ export function PerformanceCharts() {
|
||||
<Tooltip
|
||||
contentStyle={tooltipStyle}
|
||||
labelStyle={{ color: '#9ca3af' }}
|
||||
formatter={(value: number) => [`${value.toFixed(2)}%`, 'Drawdown']}
|
||||
formatter={(value) => [`${Number(value).toFixed(2)}%`, 'Drawdown']}
|
||||
/>
|
||||
<Area
|
||||
type="monotone"
|
||||
|
||||
Reference in New Issue
Block a user