import * as echarts from 'echarts';
var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;
option = {
series: [{
type: 'gauge',
boundaryGap: ['0', '100'],
radius: [120],
startAngle: 225,
min: 0,
max: 100,
pointer: {
show: false
},
progress: {
show: true,
overlap: false,
roundCap: true,
clip: false,
itemStyle: {
borderWidth: 1,
// borderColor: '#554640',
color: '#91cc75'
}
},
axisLine: {
roundCap: true,
lineStyle: {
width: 20,
}
},
splitLine: {
show: false,
},
axisTick: {
show: false
},
axisLabel: {
show: false,
},
data: [{
value: 25,
name: '培训办班',
title: {
offsetCenter: ['0%', '75%']
},
detail: {
offsetCenter: ['0%', '0%']
}
}, ],
title: {
fontSize: 24
},
detail: {
width: 50,
height: 14,
fontSize: 54,
formatter: '{value}'
},
}]
};
option && myChart.setOption(option);
效果图如下: