fix(charts): единый стиль AreaChart с градиентом
Общий AreaTrendChart для мониторинга и daily-графиков, StatisticSparklineCard на дашборде. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,16 +1,7 @@
|
||||
import React from 'react';
|
||||
import { Card, Col } from 'antd';
|
||||
import {
|
||||
LineChart,
|
||||
Line,
|
||||
XAxis,
|
||||
YAxis,
|
||||
CartesianGrid,
|
||||
Tooltip,
|
||||
Legend,
|
||||
ResponsiveContainer,
|
||||
} from 'recharts';
|
||||
import { DayCount } from '../types/api';
|
||||
import AreaTrendChart from './AreaTrendChart';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
@@ -32,16 +23,13 @@ const DailyLineChartCard: React.FC<Props> = ({ title, data, color, lg = 12 }) =>
|
||||
return (
|
||||
<Col xs={24} lg={lg}>
|
||||
<Card title={title}>
|
||||
<ResponsiveContainer width="100%" height={300}>
|
||||
<LineChart data={chartData}>
|
||||
<CartesianGrid strokeDasharray="3 3" />
|
||||
<XAxis dataKey="date" />
|
||||
<YAxis allowDecimals={false} />
|
||||
<Tooltip />
|
||||
<Legend />
|
||||
<Line type="monotone" dataKey="count" stroke={color} name={title} />
|
||||
</LineChart>
|
||||
</ResponsiveContainer>
|
||||
<AreaTrendChart
|
||||
data={chartData}
|
||||
xKey="date"
|
||||
series={[{ key: 'count', color, name: title }]}
|
||||
height={300}
|
||||
yAllowDecimals={false}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user