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
+5 -4
View File
@@ -1,6 +1,7 @@
import { col } from '../csv.js';
import {
PALETTE, FONT, axisCommon, categoryAxis, titleStyle, legendStyle,
financialViewDisclosure, financialViewLabel, shortStandalonePeriod,
lineSeries, footnote, watermarks, LAYOUT,
} from '../theme.js';
@@ -8,7 +9,7 @@ import {
* 泡泡玛特主要IP收入趋势图
* 多条折线展示各IP的收入变化
*/
export function ipChart(rows, { width, height }) {
export function ipChart(rows, { width, height, view = 'all' }) {
// 提取时期(从第一行的列名)
const periods = Object.keys(rows[0]).filter(k => k !== 'ip');
@@ -42,8 +43,8 @@ export function ipChart(rows, { width, height }) {
backgroundColor: '#fff',
title: {
...titleStyle,
text: '泡泡玛特主要IP收入趋势(2021H1-2025H2)',
subtext: '单位:亿元',
text: `泡泡玛特主要IP收入趋势(${financialViewLabel(view)})`,
subtext: ['单位:亿元;H2为单独半年', financialViewDisclosure(view)].filter(Boolean).join('\n'),
},
legend: {
...legendStyle,
@@ -62,7 +63,7 @@ export function ipChart(rows, { width, height }) {
data: periods,
axisLabel: {
...categoryAxis.axisLabel,
formatter: (value) => String(value).replace(/^20/, ''),
formatter: shortStandalonePeriod,
},
},
yAxis: {