优化:取消内部缩放并统一图表和冻结位置

This commit is contained in:
2026-11-01 15:13:23 +08:00
parent 19bd9b0122
commit e6ceae12f0
5 changed files with 31 additions and 25 deletions
+2 -3
View File
@@ -55,11 +55,10 @@ import { downloadMetricWorkbook } from './metricWorkbook';
echarts.use([BarChart, LineChart, GraphicComponent, GridComponent, LegendComponent, MarkLineComponent, TooltipComponent, SVGRenderer]);
const MONTHS = Array.from({ length: 12 }, (_, index) => `${String(index + 1).padStart(2, '0')}月`);
// 图表为保持坐标交互准确使用局部 zoom,字体需抵消该缩放以匹配页面正文。
// 图表直接沿用页面字号,不再补偿内部缩放。
function queryChartTypography(node: HTMLElement) {
const css = getComputedStyle(node);
const zoom = Number.parseFloat(css.zoom) || 1;
const size = (token: string, fallback: number) => Math.round((Number.parseFloat(css.getPropertyValue(token)) || fallback) / zoom * 10) / 10;
const size = (token: string, fallback: number) => Math.round((Number.parseFloat(css.getPropertyValue(token)) || fallback) * 10) / 10;
return {
fontFamily: css.getPropertyValue('--font-ui').trim() || css.fontFamily,
numericFamily: css.getPropertyValue('--font-numeric').trim() || css.fontFamily,