feat(ppmt): 新增分地区收入占比与门店数量图表

- 新增分地区收入占比、零售门店数量、机器人商店数量三张图表及对应 CSV 数据
- 渠道收入图矮段标签外置并扇形排布,避免段内标签挤压
- IP 收入占比图改用 standardLegend 统一图例样式
- 折线标注增加白底描边,提升可读性
This commit is contained in:
R524809
2026-08-31 16:31:44 +08:00
parent d51890a450
commit 2555453b79
17 changed files with 573 additions and 35 deletions
+6 -23
View File
@@ -1,7 +1,7 @@
import {
PALETTE, FONT, axisCommon, categoryAxis, titleStyle, LEGEND_ITEM_WIDTH,
PALETTE, FONT, axisCommon, categoryAxis, titleStyle,
financialViewDisclosure, financialViewLabel, shortStandalonePeriod,
barSeries, footnote, watermarks, LAYOUT,
standardLegend, barSeries, footnote, watermarks, LAYOUT,
} from '../theme.js';
/**
@@ -36,9 +36,6 @@ const COLORS = {
'外采及其他': '#8C8C8C',
};
const LEGEND_WIDTH = 160;
const LEGEND_RIGHT = 20;
export function ppmtIpShareHistoryChart(rows, { width, height, view = 'all' }) {
const periods = Object.keys(rows[0]).filter((k) => k !== 'ip');
const names = rows.map((r) => r.ip);
@@ -53,17 +50,8 @@ export function ppmtIpShareHistoryChart(rows, { width, height, view = 'all' }) {
text: `泡泡玛特各IP收入占比(${financialViewLabel(view)})`,
subtext: ['占当期IP收入合计的比重;H2为下半年单期,非全年累计', financialViewDisclosure(view)].filter(Boolean).join('\n'),
},
legend: {
orient: 'vertical',
right: LEGEND_RIGHT,
width: LEGEND_WIDTH,
top: 'middle',
itemGap: 12,
itemWidth: LEGEND_ITEM_WIDTH,
itemHeight: 14,
data: names,
textStyle: { color: PALETTE.ink, fontSize: 12, fontFamily: FONT },
},
// 11 个系列较多:紧凑间距靠 ECharts 自动换行成多行
legend: standardLegend(names, { itemGap: 12, itemWidth: 14, itemHeight: 14 }),
tooltip: {
trigger: 'axis',
axisPointer: { type: 'shadow' },
@@ -80,12 +68,7 @@ export function ppmtIpShareHistoryChart(rows, { width, height, view = 'all' }) {
.join('<br/>');
},
},
grid: {
left: 78,
right: LEGEND_RIGHT + LEGEND_WIDTH + 20,
top: LAYOUT.gridTop,
bottom: 70,
},
grid: { left: 78, right: 82, top: LAYOUT.gridTop, bottom: 70 },
xAxis: {
...categoryAxis,
data: periods,
@@ -114,7 +97,7 @@ export function ppmtIpShareHistoryChart(rows, { width, height, view = 'all' }) {
fontFamily: FONT,
fontWeight: 500,
// 低于 4% 的段塞不进字,留空靠 tooltip 读数
formatter: (p) => (p.value >= 4 ? p.value.toFixed(1) : ''),
formatter: (p) => (p.value >= 4 ? `${p.value.toFixed(1)}%` : ''),
},
emphasis: { focus: 'series' },
})),