最近项目需求,写一个类似仪表盘的图表,因为对echarts的配置项不太熟悉,记录一下
不是最终效果,后续还在优化
import * as echarts from 'echarts';
var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;
option = {
series: [
{
type: 'gauge',
center: ['50%', '60%'],
startAngle: 200,
endAngle: -20,
min: 0,
max: 40,
splitNumber: 10,
itemStyle: {
color: '#0EA80E'
},
progress: {
show: true,
width: 25
},
pointer: {
show: false
},
axisLine: {
lineStyle: {
width: 25
}
},
axisTick: {
distance: 3,
length:18,
splitNumber: 5,
lineStyle: {
width: 2,
color: '#073769'
}
},
splitLine: {
show:false,
distance: -52,
length: 14,
lineSty