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
+9
View File
@@ -161,6 +161,15 @@ export const LAYOUT = {
gridTop: 145, // 绘图区顶部边距(图例到绘图区约 60px)
};
/** 数值轴整齐上限候选:轴 max 从中取第一个能容纳数据的刻度 */
export const NICE_AXIS_MAX = [20, 25, 50, 60, 80, 100, 120, 150, 200, 250, 300, 400, 500, 600, 800, 1000];
/** 按数据最大值取整齐轴上限;超出候选表尾时按 100 的整数倍向上取整并留 20% 余量 */
export function niceAxisMax(dataMax) {
return NICE_AXIS_MAX.find((max) => max >= dataMax * 1.02)
?? Math.ceil((dataMax * 1.2) / 100) * 100;
}
// 统一图例图标宽度,同时保留 ECharts 按系列类型生成的形状。
export const LEGEND_ITEM_WIDTH = 20;