style(MainBusinessAnalysis): 优化主营业务饼图布局避免遮挡

- 简化标题为"主营业务构成(报告期)",移除冗余副标题
- 图例从左侧垂直改为底部水平排列,避免与饼图重叠
- 饼图居中显示(center: 50%, 48%)
- 饼图标签简化为仅显示百分比

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zdl
2025-12-26 16:31:22 +08:00
parent 35f31d4e1b
commit 85e24f64f0
2 changed files with 14 additions and 15 deletions

View File

@@ -248,8 +248,8 @@ export const MainBusinessAnalysis: React.FC<MainBusinessAnalysisProps> = ({
}));
const pieOption = getMainBusinessPieOption(
`主营业务构成 - ${latestPeriod.report_type}`,
dataSource === 'industry' ? '按行业分类' : '按产品分类',
`主营业务构成${latestPeriod.report_type}`,
'',
pieData
);

View File

@@ -238,22 +238,18 @@ const BLACK_GOLD_PIE_COLORS = chartTheme.goldSeries;
*/
export const getMainBusinessPieOption = (
title: string,
subtitle: string,
_subtitle: string,
data: { name: string; value: number }[]
) => {
return {
title: {
text: title,
subtext: subtitle,
left: 'center',
top: 0,
textStyle: {
color: fui.gold,
fontSize: 14,
},
subtextStyle: {
color: '#A0AEC0',
fontSize: 12,
},
},
tooltip: {
trigger: 'item',
@@ -269,26 +265,29 @@ export const getMainBusinessPieOption = (
},
},
legend: {
orient: 'vertical',
left: 'left',
top: 'center',
orient: 'horizontal',
bottom: 0,
left: 'center',
textStyle: {
color: '#E2E8F0',
fontSize: 12,
fontSize: 11,
},
itemWidth: 12,
itemHeight: 12,
itemGap: 8,
},
color: BLACK_GOLD_PIE_COLORS,
series: [
{
type: 'pie',
radius: '55%',
center: ['55%', '50%'],
radius: '50%',
center: ['50%', '48%'],
data: data,
label: {
show: true,
color: '#E2E8F0',
fontSize: 11,
formatter: '{b}: {d}%',
formatter: '{d}%',
},
labelLine: {
lineStyle: {