feat: 优化泡泡玛特的图表

This commit is contained in:
R524809
2026-09-10 17:44:09 +08:00
parent a6387f8220
commit 417116b928
14 changed files with 327 additions and 299 deletions
+7 -3
View File
@@ -1,7 +1,7 @@
import { col } from '../csv.js';
import {
PALETTE, FONT, axisCommon, categoryAxis, titleStyle, legendStyle,
financialViewDisclosure, financialViewLabel, shortStandalonePeriod,
financialViewDisclosure, financialViewLabel, shortStandalonePeriod, niceAxisMax,
lineSeries, footnote, watermarks, LAYOUT,
} from '../theme.js';
@@ -39,6 +39,10 @@ export function ipChart(rows, { width, height, view = 'all' }) {
});
});
// 轴上限随数据走(THE MONSTERS 2025 已超 140 亿),写死会把爆款折线顶出绘图区
const values = rows.flatMap((row) => periods.map((p) => row[p])).filter(Number.isFinite);
const axisMax = niceAxisMax(Math.max(...values));
return {
backgroundColor: '#fff',
title: {
@@ -74,8 +78,8 @@ export function ipChart(rows, { width, height, view = 'all' }) {
nameGap: 52,
nameTextStyle: { color: PALETTE.grey, fontSize: 13, fontFamily: FONT },
min: 0,
max: 100,
interval: 20,
max: axisMax,
interval: axisMax % 4 === 0 ? axisMax / 4 : axisMax / 5,
},
series,
graphic: [