'use client'; import React from 'react'; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts'; import { ChartConfig } from '../types'; interface LineChartComponentProps { data: any[]; config: ChartConfig; width?: number; height?: number; } /** * 꺾은선 차트 컴포넌트 * - Recharts LineChart 사용 * - 다중 라인 지원 */ export function LineChartComponent({ data, config, width = 250, height = 200 }: LineChartComponentProps) { const { xAxis = 'x', yAxis = 'y', colors = ['#3B82F6', '#EF4444', '#10B981', '#F59E0B'], title, showLegend = true } = config; // Y축 필드들 (단일 또는 다중) const yFields = Array.isArray(yAxis) ? yAxis : [yAxis]; // 사용할 Y축 키들 결정 const yKeys = yFields.filter(field => field && field !== 'y'); return (