import React from 'react'; import { Card, CardContent, Typography, Box, useTheme } from '@mui/material'; import { useTranslation } from 'react-i18next'; import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell, Legend } from 'recharts'; export default function Charts({ trendData, modelDistribution }) { const theme = useTheme(); const { t } = useTranslation(); const COLORS = [ theme.palette.primary.main, theme.palette.secondary.main, theme.palette.success.main, theme.palette.warning.main, theme.palette.error.main, theme.palette.info.main ]; return ( {/* 趋势图 */} {t('monitoring.charts.tokenTrend')} {t('monitoring.charts.inputLegend')} {t('monitoring.charts.outputLegend')} {/* 模型分布图 */} {t('monitoring.charts.distributionTitle')} {t('monitoring.charts.distributionSubtitle')} {modelDistribution.map((entry, index) => ( ))} t('monitoring.charts.tokensTooltip', { value: (value / 1000).toFixed(1) })} contentStyle={{ backgroundColor: theme.palette.background.paper, border: `1px solid ${theme.palette.divider}`, borderRadius: 8 }} /> ( {value} )} /> {/* 中间文字 */} {/* {modelDistribution.length} Models */} ); }