Fix type error in Analytics
Fixes a type error in Analytics.tsx related to the tickFormatter in the YAxis of the BarChart component. The tickFormatter was receiving a string value instead of a number, causing a TypeScript error. The fix ensures that the value passed to the number formatter is indeed a number.
This commit is contained in:
@@ -113,17 +113,20 @@ const Analytics = () => {
|
|||||||
currency: 'KRW',
|
currency: 'KRW',
|
||||||
notation: 'compact',
|
notation: 'compact',
|
||||||
maximumFractionDigits: 1
|
maximumFractionDigits: 1
|
||||||
}).format(value)
|
}).format(Number(value))
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
formatter={(value) =>
|
formatter={(value) => {
|
||||||
new Intl.NumberFormat('ko-KR', {
|
if (typeof value === 'number') {
|
||||||
|
return new Intl.NumberFormat('ko-KR', {
|
||||||
style: 'currency',
|
style: 'currency',
|
||||||
currency: 'KRW',
|
currency: 'KRW',
|
||||||
maximumFractionDigits: 0
|
maximumFractionDigits: 0
|
||||||
}).format(value)
|
}).format(value);
|
||||||
}
|
}
|
||||||
|
return value;
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<Legend />
|
<Legend />
|
||||||
<Bar
|
<Bar
|
||||||
|
|||||||
Reference in New Issue
Block a user