效果图
legend: {
orient: 'vertical',
type: 'scroll',
bottom: '0',
left: '10',
icon: 'circle',
height: '100', // 设置高度即可实现
pageIconColor: '#1b9aee', //翻页下一页的三角按钮颜色
pageIconInactiveColor: '#7f7f7f', //翻页(即翻页到头时)
textStyle: {
lineHeight: 10
},
formatter: (name) => {
let total = 0
let target
const value = data.filter(x => x.name == name)[0].value
for (let i = 0, l = data.length; i < l; i++) {
total += data[i].value
if (data[i].name == name) {
target = data[i].value
}
}
const arr = [
name, value, ((target / total) * 100).toFixed(2) + '%'
]
return arr.join(' ')
}
},
注意: height高度必须有,否则其他参数配置好没有高度也不能实现分页