解决echarts环形图富文本标题不生效问题

120 阅读1分钟

image.png

目的:将42和全部U位的字体改为不一样大小,某度出来的不生效,如下完美解决,注意Text里面的也要改成如下:

 title: {
      show: true,
      text: '{largeText|42}\n{smallText|全部U位}',
      left: 'center',
      top: 'center',
      textStyle: {
        fontSize: 20,
        fontWeight: 'normal',
        color: '#333',
        rich: {
        largeText: {
          fontSize: 36, // 设置42的字体大小
          color: '#333'
        },
        smallText: {
          color: '#333',
          fontSize: 14 // 设置“全部U位”的字体大小
        },
        lable: {
          formatter: '{largeText|42}\n{smallText|全部U位}'
        }
      }
      },
     
}