动态圆环的简单实现
通过ajax请求后台,获取数据
var srData = [];
srData.push(
{
value:ljsrValue,
name:'累计总收入',
label: {
normal: {
formatter: '{d} %',
textStyle: {
fontSize: 18
}
}
}
}
);
srData.push(
{
value:ndjhsrValue,
name:'收入预期',
label: {
normal: {
formatter: '\n\n\n收入进度',
textStyle: {
color: '#555',
fontSize: 13
}
}
}
}
);
//console.log(srData);
var taxTypeChart = echarts.init(byId('srRingChart'));
var srRing = {
tooltip:{
trigger: 'item',
formatter: "{b}<br/> : {c} ({d}%)",
position:[10,10]
},
color: ['#CC00CC','#DDDDDD'],
series: [{
name: '收入进度',
type: 'pie',
radius: ['70%', '90%'],
center:['50%','50%'],
label: {normal: {show: true,position: 'center'}},
labelLine: {normal: {show: false}},
data: srData
}]
};
taxTypeChart.setOption(srRing);