pay-company/src/pages/index/charts/FinancialAnalysisLine.tsx
2026-02-06 17:40:04 +08:00

49 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { MyBetaModalFormProps } from '@/common';
import { Line } from '@ant-design/plots';
import { useEffect, useState } from 'react';
export default function FinancialAnalysisLine(props: MyBetaModalFormProps) {
const [houseBillsCount, setHouseBillsCount] = useState<any>({});
const config = {
data: [],
xField: '月份',
yField: '金额',
colorField: 'name',
point: {
size: 7,
},
legend: {
position: 'top',
},
tooltip: {},
style: {
// 矩形四个方向的内边距
inset: 5,
},
// 使用双Y轴因为两个指标数值范围差异大
yAxis: [
{
title: {
text: '月收款(万元)',
},
},
{
title: {
text: '收缴率(%)',
},
grid: null,
},
],
};
useEffect(() => {
setHouseBillsCount({ ...config, data: props.item || [] });
}, [props.item]);
return (
<div style={{ height: 290 }}>
<Line {...houseBillsCount} />
</div>
);
}