feat: 泡泡玛特增加年度、半年数据区分
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user