feat: 优化泡泡玛特的图表
This commit is contained in:
@@ -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: [
|
||||
|
||||
Reference in New Issue
Block a user