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

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,就是分开设置了。
除注明外的文章,均为来源:老汤博客,转载请保留本文地址!
原文地址:https://tangjiusheng.cn/js/2582.html
原文地址:https://tangjiusheng.cn/js/2582.html
