legend: [
{
left:'80',
data: ['邮件', 'QQ文件', '微信', '文件传输'],
textStyle: {
color: '#fff',
}
},
{
top:'20',
left:'80',
data:['木马','漏洞','恶意文件','其他'],
textStyle: {
color: '#fff',
}
}
],
把图里组件用数组分成2组 其他正常
通过left、top、right、bottom 使其布局
把图里组件全部对齐
通过textStyle
的formatter
搭配rich
的width
实现对齐
原理:通过富文本设置固定的宽度
legend: [
{
left:'30',
data: ['邮件', 'QQ文件', '微信', '文件传输'],
formatter: '{a|{name}}',
textStyle: {
color: '#fff',
rich:{
a:{
width: 60,
fontSize: 12
},
}
}
},
{
top:'25',
left:'30',
formatter: '{a|{name}}',
data:['木马','漏洞','恶意文件','其他'],
textStyle: {
color: '#fff',
rich:{
a:{
width: 60,
fontSize: 12
},
}
}
}
],