优化:取消内部缩放并统一图表和冻结位置
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user