在使用echarts创建环形图过程中,我想要标注一个如下格式:企业name,故障设备value,企业设备总数,但是每个企业对应的总数是不一样的,现在遇到了在formatter中设置无法满足需求的问题(现在写死200),请教各位大神,帮忙解决下。
配置项如下
option = {
calculable : true,
series : [
{
type:'pie',
radius : [80, 150],
center : ['50%', '50%'],
roseType : 'area',
label: {
normal: {
formatter: ' {b|{b}\n}{hr|}\n {c}/200 {per|{d}%} ',
backgroundColor: '#eee',
borderColor: '#aaa',
borderWidth: 1,
borderRadius: 4,
fontSize: 14,
rich: {
hr: {
borderColor: '#aaa',
width: '100%',
borderWidth: 0.5,
height: 0
},
b: {
fontSize: 16,
lineHeight: 30,
align: 'center'
},
per: {
color: '#eee',
backgroundColor: '#334455',
padding: [2, 4],
lineHeight: 30,
borderRadius: 2
}
}
}
},
data:[
{value:10, name:'上海电气'},
{value:11, name:'山东中车'},
{value:12, name:'北控水务'},
{value:14, name:'远达环保'},
{value:15, name:'江南建筑设计院'}
]
}
]
};