feat: 泡泡玛特增加年度、半年数据区分

This commit is contained in:
2026-08-30 14:49:27 +08:00
parent d010b107aa
commit d51890a450
69 changed files with 1109 additions and 258 deletions
+6 -5
View File
@@ -1,6 +1,7 @@
import { col } from '../csv.js';
import {
PALETTE, FONT, axisCommon, periodAxis, titleStyle, standardLegend,
PALETTE, FONT, axisCommon, standalonePeriodAxis, titleStyle, standardLegend,
financialViewDisclosure, financialViewLabel,
lineSeries, footnote, watermarks, LAYOUT,
} from '../theme.js';
@@ -54,15 +55,15 @@ function labeledData(rows, key) {
});
}
export function ppmtMarginsChart(rows, { width, height }) {
export function ppmtMarginsChart(rows, { width, height, view = 'all' }) {
const pct = (p) => `${p.value}%`;
return {
backgroundColor: '#fff',
title: {
...titleStyle,
text: '泡泡玛特利润率与费用率拆解(2020H1-2026H1)',
subtext: '毛利率抬升叠加费用率下降,共同推动净利率走高(H1为半年,H2为全年累计)',
text: `泡泡玛特利润率与费用率拆解(${financialViewLabel(view)})`,
subtext: ['毛利率抬升叠加费用率下降,共同推动净利率走高', financialViewDisclosure(view)].filter(Boolean).join('\n'),
},
legend: standardLegend(SERIES.map((series) => series.name)),
grid: { left: 78, right: 56, top: LAYOUT.gridTop, bottom: 80 },
@@ -71,7 +72,7 @@ export function ppmtMarginsChart(rows, { width, height }) {
valueFormatter: (v) => `${v}%`,
textStyle: { fontFamily: FONT },
},
xAxis: { ...periodAxis, data: col(rows, 'period') },
xAxis: { ...standalonePeriodAxis, data: col(rows, 'period') },
yAxis: {
...axisCommon,
type: 'value',