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
+14 -10
View File
@@ -1,19 +1,23 @@
import { col } from '../csv.js';
import {
FINANCIAL_COLORS, PALETTE, FONT, axisCommon, periodAxis, titleStyle, legendStyle,
FINANCIAL_COLORS, PALETTE, FONT, axisCommon, standalonePeriodAxis, titleStyle, legendStyle,
financialViewDisclosure, financialViewLabel,
lineSeries, footnote, watermarks, LAYOUT,
} from '../theme.js';
/** 泡泡玛特经营现金流与净利润:观察利润的现金兑现能力。 */
export function cashConversionChart(rows, { width, height }) {
export function cashConversionChart(rows, { width, height, view = 'all' }) {
const periods = col(rows, 'period');
const conversionMax = Math.max(...col(rows, 'cash_conversion').filter(Number.isFinite));
const conversionAxisMax = Math.max(200, Math.ceil((conversionMax * 1.1) / 100) * 100);
const barWidth = view === 'all' ? 14 : view === 'halfyear' ? 24.96 : 31.2;
return {
backgroundColor: '#fff',
title: {
...titleStyle,
text: '泡泡玛特经营现金流与净利润(年度)',
subtext: '现金转换率 = 经营活动现金流净额 / 净利润;单位:亿元',
text: `泡泡玛特经营现金流与净利润(${financialViewLabel(view)})`,
subtext: ['现金转换率 = 经营活动现金流净额 / 净利润;单位:亿元', financialViewDisclosure(view)].filter(Boolean).join('\n'),
},
legend: {
...legendStyle,
@@ -27,7 +31,7 @@ export function cashConversionChart(rows, { width, height }) {
textStyle: { fontFamily: FONT },
valueFormatter: (value) => `${value.toFixed(1)}`,
},
xAxis: { ...periodAxis, data: periods },
xAxis: { ...standalonePeriodAxis, data: periods },
yAxis: [
{
...axisCommon,
@@ -48,8 +52,8 @@ export function cashConversionChart(rows, { width, height }) {
nameRotate: -90,
nameTextStyle: { color: PALETTE.grey, fontSize: 13, fontFamily: FONT },
min: 0,
max: 200,
interval: 50,
max: conversionAxisMax,
interval: conversionAxisMax / 4,
axisLabel: { ...axisCommon.axisLabel, formatter: '{value}%' },
splitLine: { show: false },
},
@@ -59,7 +63,7 @@ export function cashConversionChart(rows, { width, height }) {
name: '经营活动现金流净额',
type: 'bar',
data: col(rows, 'operating_cash_flow'),
barWidth: 31.2,
barWidth,
itemStyle: { color: FINANCIAL_COLORS.operatingCashFlow },
label: { show: true, position: 'top', color: PALETTE.ink, fontFamily: FONT, fontSize: 11, formatter: (p) => p.value.toFixed(1) },
},
@@ -67,7 +71,7 @@ export function cashConversionChart(rows, { width, height }) {
name: '净利润',
type: 'bar',
data: col(rows, 'net_profit'),
barWidth: 31.2,
barWidth,
itemStyle: { color: FINANCIAL_COLORS.netProfit },
label: { show: true, position: 'top', color: PALETTE.ink, fontFamily: FONT, fontSize: 11, formatter: (p) => p.value.toFixed(1) },
},
@@ -85,7 +89,7 @@ export function cashConversionChart(rows, { width, height }) {
],
graphic: [
...watermarks(width, height),
footnote('数据来源:泡泡玛特合并现金流量表、利润表(年度口径)| @思考的Joey'),
footnote('数据来源:泡泡玛特合并现金流量表、利润表;H2为单独半年 | @思考的Joey'),
],
};
}