fix(stats): make ECharts text follow global font#61
Merged
Spr-Aachen merged 1 commit intoSpr-Aachen:mainfrom Jan 23, 2026
Merged
fix(stats): make ECharts text follow global font#61Spr-Aachen merged 1 commit intoSpr-Aachen:mainfrom
Spr-Aachen merged 1 commit intoSpr-Aachen:mainfrom
Conversation
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.
问题描述:
statistics.svelte里面的 EChartssetOption(……)没有指定任何fontFamily,ECharts 默认使用默认的字体。导致图表文字与全局字体不一致。改动内容:从页面的
getComputedStyle(...).fontFamily读取实际生效的字体,并写入 ECharts 的textStyle.fontFamily。也补齐了title.textStyle、axisLabel/axisName的fontFamily。影响范围:只修改了
statistics.svelte。没有改变数据和交互逻辑,只影响了图表文字的字体,使字体与全局字体一致。本地测试:已在本地通过
pnpm dev进行测试。右侧的「统计」的字体已经跟全局一致。截图对比(点击展开)
默认字体:
LXGWWenKaiScreen: