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,
PALETTE, FONT, axisCommon, standalonePeriodAxis, titleStyle,
financialViewDisclosure, financialViewLabel,
lineSeries, standardLegend, footnote, watermarks, LAYOUT,
} from '../theme.js';
@@ -15,15 +16,15 @@ import {
*/
const LINE_COLOR = '#7B2D42';
export function ppmtCoreMarginChart(rows, { width, height }) {
export function ppmtCoreMarginChart(rows, { width, height, view = 'all' }) {
const pct = (p) => `${p.value.toFixed(1)}%`;
return {
backgroundColor: '#fff',
title: {
...titleStyle,
text: '泡泡玛特核心利润率(20H1-26H1)',
subtext: '核心利润率 = 毛利率 − 销售费用率 − 管理费用率,剔除汇兑与投资等非主业扰动',
text: `泡泡玛特核心利润率(${financialViewLabel(view)})`,
subtext: ['核心利润率 = 毛利率 − 销售费用率 − 管理费用率,剔除汇兑与投资等非主业扰动', financialViewDisclosure(view)].filter(Boolean).join('\n'),
},
legend: standardLegend(['核心利润率'], { itemGap: 32 }),
grid: { left: 78, right: 60, top: LAYOUT.gridTop, bottom: 90 },
@@ -32,7 +33,7 @@ export function ppmtCoreMarginChart(rows, { width, height }) {
valueFormatter: (v) => `${v.toFixed(1)}%`,
textStyle: { fontFamily: FONT },
},
xAxis: { ...periodAxis, data: col(rows, 'period') },
xAxis: { ...standalonePeriodAxis, data: col(rows, 'period') },
yAxis: {
...axisCommon,
type: 'value',