var i = 0;
var colorList = [ '#7cb7ff', '#bf95ff', '#e5e5e5', '#e5e5e5' ];
var option = {
title : {
x : "center",
text : '-',
bottom : '25%',
textStyle : {
fontSize : 18,
color : "#7cb6ff"
},
},
series : [
{
startAngle : 180,
endAngle : 0,
name : '实际完成',
type : 'gauge',
radius : 113,
min : 0,
max : 100,
splitNumber : 0,
center : [ '50%', '70%' ], // 默认全局居中
axisLine : { // 坐标轴线
lineStyle : {
color : [
[ 0, '#b3d5ff' ],
[ 1, '#eeeeee' ]
], // 属性lineStyle控制线条样式
width : 4
}
},
axisTick : {
show : false
},
axisLabel : { // 坐标轴小标记
textStyle : { // 属性lineStyle控制线条样式
fontWeight : 'bolder',
fontSize : 16,
color : 'rgba(30,144,255,0)',
}
},
splitLine : { // 分隔线
length : 10, // 属性length控制线长
lineStyle : { // 属性lineStyle(详见lineStyle)控制线条样式
width : 0,
color : '#444'
}
},
pointer : { // 分隔线 指针
color : '#666666',
width : 0,
length : 230
},
detail : {
show : false
},
},
{
name : '信用分',
type : 'gauge',
center : [ '50%', '70%' ], // 默认全局居中
startAngle : 180,
radius : 100,
endAngle : 0,
min : 0,
max : 100,
axisLine : {
show : true,
lineStyle : {
width : 20,
shadowBlur : 0,
color : [ [ 0.1, '#b7a1ff' ],
[ 0.2, '#bc9fff' ], [ 0.3, '#be9fff' ],
[ 0.4, '#c09eff' ], [ 0.5, '#b9a0ff' ],
[ 0.6, '#afa4ff' ], [ 0.7, '#a2a9ff' ],
[ 0.8, '#94adff' ], [ 0.9, '#88b2ff' ],
[ 1, '#80b5ff' ] ]
}
},
axisTick : {
length : 20,
splitNumber : 1,
},
splitLine : {
show : true,
length : 20,
},
pointer : {
show : false,
},
detail : {
offsetCenter : [ 0, -30 ],
textStyle : {
fontSize : 20,
color : '#000',
fontWeight : 'bold'
},
formatter : function(value) {
return value + '分';
}
},
data : [ {
name : "", //安全评分
value : 0,
} ]
}
]
};
// 数据
var score = 90;
option.title.text = '-优秀-';
option.series[0].axisLine.lineStyle.color[0][0] = Number(score/100);
option.series[1].data[0].value = score;
myChart.setOption(option);