@echarts环形图实例
var dom = document.getElementById(“container1”);
var myChart = echarts.init(dom);
var app = {};
option = null;
app.title = ‘环形图’;
var value = ‘PLC’;
option = {
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)"
},
title: {
text: '{a|' + value + '}',
x: 'center',
y: 'center',
textStyle: {
rich: {
a: {
fontSize: 25,
fontWeight: 700,
color: '#00fbfe',
padding: [10 ,0,20, 0]
},
c: {
fontSize: 16,
color: '#579ff9',
fontWeight: 500,
padding: [0, 0]
}
}
}
},
color:['#579ff9','#fef000'],
series: [
{
name:'PLC',
type:'pie',
radius: ['50%', '70%'],
avoidLabelOverlap: false,
label: {
normal: {
show: false,
position: 'center'
},
emphasis: {
show: true,
textStyle: {
fontSize: '24',
color:'#00fcff',
fontWeight: 'bold'
}
}
},
labelLine: {
normal: {
show: false
}
},
data:[
{value:301, name:'在线'},
{value:56, name:'离线'}
]
}
]
};
;
if (option && typeof option === "object") {
myChart.setOption(option, true);
}