style: area chart

This commit is contained in:
jialin
2024-06-30 21:30:42 +08:00
parent 5746eb191f
commit 018c8cd208
16 changed files with 204 additions and 34 deletions
+7 -2
View File
@@ -1,4 +1,5 @@
import { Line } from '@ant-design/plots';
import EmptyData from './empty-data';
interface LineChartProps {
title?: string;
@@ -7,7 +8,7 @@ interface LineChartProps {
color?: string[];
xField?: string;
yField?: string;
locale: string;
locale?: string;
labelFormatter?: (v: any) => string;
slider?: any;
}
@@ -79,7 +80,11 @@ const LineChart: React.FC<LineChartProps> = (props) => {
};
return (
<>
<Line data={data} {...config} />
{data.length === 0 ? (
<EmptyData height={height} title={title} />
) : (
<Line data={data} {...config} />
)}
</>
);
};