图中白色标题为主标题 蓝色时间设置为副标题
位置分别设置center和right
title: [
{
left: "center",
// 标题
text: chartData.specarea + chartData.carnumber,
textStyle: {
color: "white", //标签文字颜色改为白色
},
},
{
// color: "#0fa4ee",
// left: "center",
left: "right",
// 标题
subtext: `采集时间:` + chartData.spectime,
// 副标题样式
subtextStyle: {
color: "#0fa4ee",
fontSize: 12,
fontWeight: "normal",
},
},
],
echarts中的title配置项设置成数组 利用多个标题分别设置主标题和副标题位置
首先第一项先只设置主标题 位置是 left:center
第二项设置副标题位置设置left:right
就是分开设置而已啦