均匀分割饼图
配置项如下
var data = [];
var labelData = [];
for (var i = 0; i < 100; ++i) {
data.push({
value: Math.random() * 10 + 10 - Math.abs(i - 12),
name: i + ':00'
});
labelData.push({
value: 1,
name: i ,
itemStyle:{
normal: {
color: "#333"
}
}
});
}
for(var i=0;i<labelData.length;++i){
if(labelData[i].name < 60){
labelData[i].itemStyle = {
normal: {
color: "rgb(248, 237, 133)"
}
}
}
}
option = {
backgroundColor:'#000',
title: {
text: '60%',
left: '50%',
textAlign: 'center',
top: '45%',
textStyle:{
fontSize:60,
color:'#fff'
}
},
series: [{
hoverAnimation:false,
type: 'pie',
data: labelData,
radius: ['45%', '60%'],
itemStyle: {
normal: {
borderWidth:2,
borderColor: 'black'
}
},
label: {
normal: {
position: 'inside',
show:false,
}
}
}]
};