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 -12
View File
@@ -1,6 +1,7 @@
import { col } from '../csv.js';
import {
PALETTE, FONT, axisCommon, categoryAxis, titleStyle, legendStyle,
PALETTE, FONT, axisCommon, standalonePeriodAxis, titleStyle, legendStyle,
financialViewDisclosure, financialViewLabel,
footnote, watermarks, LAYOUT,
} from '../theme.js';
@@ -8,7 +9,7 @@ import {
* 泡泡玛特品类收入结构图
* 堆叠柱状图展示各品类的收入占比和增长
*/
export function categoryChart(rows, { width, height }) {
export function categoryChart(rows, { width, height, view = 'all' }) {
// 过滤掉表头行("品类"那一行)
const dataRows = rows.filter(r => r.period && r.period !== '品类');
const periods = col(dataRows, 'period');
@@ -17,8 +18,8 @@ export function categoryChart(rows, { width, height }) {
backgroundColor: '#fff',
title: {
...titleStyle,
text: '泡泡玛特品类收入结构(2024H1-2025H2)',
subtext: '单位:亿元',
text: `泡泡玛特品类收入结构(${financialViewLabel(view)})`,
subtext: ['单位:亿元;H2为下半年单期', financialViewDisclosure(view)].filter(Boolean).join('\n'),
},
legend: {
...legendStyle,
@@ -41,14 +42,7 @@ export function categoryChart(rows, { width, height }) {
return result;
},
},
xAxis: {
...categoryAxis,
data: periods,
axisLabel: {
...categoryAxis.axisLabel,
formatter: (value) => String(value).replace(/^20/, ''),
},
},
xAxis: { ...standalonePeriodAxis, data: periods },
yAxis: {
...axisCommon,
type: 'value',