- {payload.map((entry, index) => (
+ {payload.map((entry, index: number) => (
{entry.value}
@@ -77,7 +108,7 @@ export default function Chart({chartConfig=undefined, chartData=[], chartTitle='
fontWeight={500}
label={yFieldText ? { value: yFieldText, className:"text-[13px] foont-bold", position: 'top', textAnchor: 'middle', offset: 20 } : undefined}
/>
-
}/>
+
}/>
{chartData && chartData.length > 0 && (
Object.keys(chartData[0])
.filter(key => key !== "label")
diff --git a/packages/common/business_components/src/ui/chart/LineChart.tsx b/packages/common/business_components/src/ui/chart/LineChart.tsx
index 136034e00..c005efbdf 100644
--- a/packages/common/business_components/src/ui/chart/LineChart.tsx
+++ b/packages/common/business_components/src/ui/chart/LineChart.tsx
@@ -1,16 +1,14 @@
"use client"
import type { CSSProperties } from "react";
+import { CartesianGrid, Legend, Line, LineChart, Tooltip, XAxis, YAxis } from "recharts";
import {
Card,
CardContent
} from "./lib/card";
import {
ChartContainer,
- ChartTooltip,
- ChartTooltipContent,
type ChartConfig
} from "./lib/chart";
-import { CartesianGrid, Legend, Line, LineChart, Tooltip, XAxis, YAxis } from "recharts";
/** 차트 기본 스타일 */
const styles = {
@@ -41,9 +39,20 @@ const styles = {
marginTop: "10px",
} as CSSProperties,
};
-
// 커스텀 툴팁
-const CustomTooltip = ({ active, payload, label }) => {
+const CustomTooltip = ({
+ active,
+ payload,
+ label
+}: {
+ active?: boolean;
+ payload?: Array<{
+ name: string;
+ value: number;
+ color: string;
+ }>;
+ label?: string;
+}) => {
if (active && payload && payload.length) {
return (