From 7bd2c39eab2cc1f00524ee19e4cf83e83021c175 Mon Sep 17 00:00:00 2001 From: 15945162479 <15945162479@qq.com> Date: Sat, 13 Dec 2025 14:46:17 +0800 Subject: [PATCH] Add File --- src/family/components/TrendChart.tsx | 70 ++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 src/family/components/TrendChart.tsx diff --git a/src/family/components/TrendChart.tsx b/src/family/components/TrendChart.tsx new file mode 100644 index 0000000..de09f37 --- /dev/null +++ b/src/family/components/TrendChart.tsx @@ -0,0 +1,70 @@ +import React from 'react'; +import { + LineChart, + Line, + XAxis, + YAxis, + CartesianGrid, + Tooltip, + ResponsiveContainer, +} from 'recharts'; + +interface TrendChartProps { + title: string; + data: Array<{ + date: string; + value: number; + label?: string; + }>; + dataKey?: string; + color?: string; + height?: number; +} + +/** + * 趋势图表组件 + * 用于展示情绪、用药依从性等趋势 + */ +export const TrendChart: React.FC = ({ + title, + data, + dataKey = 'value', + color = '#1890ff', + height = 300, +}) => { + return ( +
+

{title}

+ + + + + + + + + +
+ ); +};