echarts 怎么自适应页面大小

页面放上去后发现字太小了 需要手动调整字体大小还是可以自适应呢?echarts图表的大小如何更具页面的大小自适应呢?求解答谢谢

img

你见过canvas 字体能自适应吗?
js监听屏幕的变化,字体 选择
const cancalDebounce =debounce(function(){console.log(document.documentElement.clientWidth)},500);
window.addEventListener('resize', cancalDebounce)

function transformFontSize(fontsize) {
        // 获取屏幕宽度
      const width = window.screen.width
      const ratio = width / 1920
      // 取下整
      return parseInt(fontsize * ratio)
    }

label: {
              normal: {
                formatter: this.waterData[2] + '',
                textStyle: {
                  fontSize: this.transformFontSize(32),
                  color: '#dbfbfc'
                },
                position: ['50%', '30%']
              }
            }

1.字体的适应可以选择rem适配(主流适配方法),vw适配
2.图标根据页面变化适配,监听window的resize事件,然后图标外面的盒子调用resize()方法