封装一个echart字体大小自适应函数

// 自适应echart字体大小
export const fontSize = (res) => {
  let clientWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
  if (!clientWidth) return;
  let fontSize = clientWidth / 2560;
  return res * fontSize;
};

 

posted @ 2022-10-19 09:29  RHCHIK  阅读(131)  评论(0编辑  收藏  举报