option1: {
title:[
{ // 设置第一个图表标题
show: true,
text:'标题一',
left: 'left', // 设置为 'center' 使得标题在饼图上方
top: '0%', // 调整此值改变标题与饼图的距离
},
{ // 设置第二个图表标题
show: true,
text:'标题二',
right: '40%', // 设置为 'center' 使得标题在饼图上方
top: '0%', // 调整此值改变标题与饼图的距离
}
],
tooltip: {
trigger: 'item',
formatter: ''
},
legend: {
orient: 'horizontal',
bottom: 'bottom'
},
label:{
show:true,
position: 'inner',
formatter: '{b} ({d}%)'
},
series: [
{
name: '项目1',
type: 'pie',
center:['25%','50%'],
radius: ['0%', '50%'],
data: [],
},
{
name: '项目2',
type: 'pie',
center:['75%','50%'],
radius: ['0%', '50%'],
data: [],
}
]
},
echarts5.4.2版本分别设置两个图表上方标题的位置
最新推荐文章于 2024-05-19 09:47:39 发布