import { XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, ReferenceLine, Area, AreaChart } from 'recharts'; import type { SentimentTrend } from '@/types'; interface SentimentTrendProps { data: SentimentTrend[]; } export function SentimentTrendChart({ data }: SentimentTrendProps) { const CustomTooltip = ({ active, payload, label }: any) => { if (active && payload && payload.length) { const value = payload[0].value; let sentiment = '中性'; let color = '#f97316'; if (value <= 20) { sentiment = '极度恐惧'; color = '#dc2626'; } else if (value <= 40) { sentiment = '恐惧'; color = '#ef4444'; } else if (value <= 60) { sentiment = '中性'; color = '#f97316'; } else if (value <= 80) { sentiment = '贪婪'; color = '#22c55e'; } else { sentiment = '极度贪婪'; color = '#16a34a'; } return (
{label}
{value}
{sentiment}