echarts主副标题位置设置(主副标题位置分开调整教程)

echarts中的title配置项设置成数组利用多个标题分别设置主标题和副标题位置,图片中白色标题为主标题,蓝色时间设置为副标题。

echarts主副标题位置设置

echarts主副标题位置设置实例代码如下:

title: [
 {
  text: "12331车号111",//主标题
  left: '20%', //标题的位置 默认是left,其余还有center、right属性
  top: '40%',
  textStyle: {
   color: "#FFFFFF",
   fontSize: 14,
   fontWeight: 'normal'
  }
 },
{
 subtext: "采集时间:2022-06-04 00:00:00+08", //副标题
 // itemGap: 6, //主副标题间距
 left: '20%', //标题的位置 默认是left,其余还有center、right属性
 top: '50%',
 subtextStyle: {
    color: "#FFFFFF",
    fontSize: 32,
    fontWeight: '600',
    textAlign: 'center'
  }
 }
],


注:
首先第一项先只设置主标题 位置是 left:center,第二项设置副标题位置设置left:right,就是分开设置了。

版权声明:
作者:Joker 链接:https://hooper.eu.org/archives/23094
文章版权归作者所有,转载请注明出处。
THE END
分享
二维码
打赏
< <上一篇
下一篇>>