option = {
series: [
{
type: 'pie',
radius: ['50%', '70%'],
avoidLabelOverlap: false,
label: {
show: true,
position: "inside",
formatter: function(params) {
var name = params.name;
var icon = params.icon;
return `{a|${name}}\n{b|${icon}}`
},
rich: {
a: {
fontSize: 16,
lineHeight: 24,
align: 'center',
verticalAlign: 'middle'
},
b: {
height: 24,
width: 24,
align: 'center',
verticalAlign: 'middle',
backgroundColor: {
image: 'image://https://echarts.apache.org/examples/data/asset/img/favicon.png'
}
}
}
},
data: [
{value: 335, name: '直接访问'},
{value: 310, name: '邮件营销'},
{value: 234, name: '联盟广告'},
{value: 135, name: '视频广告'},
{value: 1548, name: '搜索引擎'}
]
}
]
};
echarts tree图 label中的rich属性,设置问题和图片居中
最新推荐文章于 2023-08-10 09:46:58 发布