效果图是这样子的:
右侧的怎么变成两行两列的?然后饼图怎么渐变?
color: ["#63E315", "#00FFFF", "#00CCFF"],
legend: {
width: '100%',
itemWidth: 6,
itemHeight: 6,
icon: 'circle',
textStyle: {
padding: [14, 0, 0, 0],
rich: {
label: {
fontSize: 12,
lineHeight: 16,
fontWeight: 'normal',
color: '#ffffff'
},
value: {
fontSize: 14,
lineHeight: 17,
fontWeight: 'bold',
color: '#ffffff'
}
}
},
itemGap: 15,
orient: 'vertical',
right: '0',
top: '10',
data: this.zhijiaData,
formatter: (name) => {
let total = 0
let target = 0
for (var i = 0; i < this.zhijiaData.length; i++) {
total += Number(this.zhijiaData[i].value)
if (this.zhijiaData[i].name === name) {
target = this.zhijiaData[i].value
}
}
const v = (target / total * 100).toFixed(0)
return `{label|${name}}\n{value|${target} ${v}%}`
}
},
分行可以设置高
渐变可以设置color:
具体的颜色对应可以根据需求调整,
color
也可以与legend
,series
等同级