style(dashboard): 统一所有图表 Legend 与 Tooltip 样式为外部自定义 Tooltip#177
Merged
Conversation
- 重构 Tooltip 处理器为工厂函数 makeExternalTooltipHandler,支持自定义格式化与合计行 - 修复甜甜圈图 Legend 字体在暗色背景上不可见的问题(设置 fontColor/color: #e6edf3) - 统一甜甜圈图 Legend 尺寸与间距为 COMMON_LEGEND 基准配置 - 将全部 4 个图表 Tooltip 统一为深色半透明背景、实心小圆点指示器样式 🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
修复 Dashboard「供应商请求分布(近 7 天)」甜甜圈图 Legend 字体颜色在暗色背景上不可见的问题,并将全部 4 个图表的 Tooltip 统一为自定义外部 Tooltip 样式(实心小圆点指示器、深色半透明背景)。
变更内容
1. 重构 Tooltip 处理器为工厂函数
createExternalTooltipHandler重构为makeExternalTooltipHandler(opts)工厂函数fmtValue(值格式化)、showTotal(合计行)、fmtTotal(合计格式化)选项backgroundColor数组)和折线图(borderColor字符串)dataset.label,回退到dp.label(甜甜圈图)2. 修复甜甜圈图 Legend 可读性
COMMON_LEGEND.labels统一尺寸与间距(boxWidth:10, boxHeight:10, padding:14)generateLabels中显式设置fontColor/color: '#e6edf3',确保暗色背景上清晰可读3. 统一全部图表 Tooltip 样式
fmtValue: fmtNum)fmtValue: v => v.toLocaleString() + ' 次')fmtTokens)fmtTokens,移除冗余 callbacks)验证方式
🤖 Generated with Claude Code