Commit ccd0d795 authored by jiaxu.yan's avatar jiaxu.yan

Merge branch 'develop' of http://gitlab.91isoft.com:90/car-test/web into develop

parents 102d679d 02d3180f
...@@ -56,6 +56,9 @@ export default { ...@@ -56,6 +56,9 @@ export default {
this.chart = this.$echarts.init(this.$refs.chart) this.chart = this.$echarts.init(this.$refs.chart)
// 3.配置数据 // 3.配置数据
const option = { const option = {
tooltip: {
trigger: 'item'
},
title: { title: {
text: '用例风险程度概览', text: '用例风险程度概览',
left: 'left', left: 'left',
...@@ -65,79 +68,126 @@ export default { ...@@ -65,79 +68,126 @@ export default {
fontSize: 16 fontSize: 16
} }
}, },
legend: {
top: 'bottom'
},
color: ['#E55868', '#F6B24B', '#1A6FD7'], color: ['#E55868', '#F6B24B', '#1A6FD7'],
series: [ series: [
{ {
type: 'gauge', type: 'pie',
anchor: { radius: ['40%', '60%'],
show: true, avoidLabelOverlap: false,
showAbove: true, padAngle: 5,
size: 18, itemStyle: {
itemStyle: { borderColor: '#fff',
color: '#FAC858' borderWidth: 10,
} borderRadius: 10
}, },
pointer: { label: {
icon: 'path://M2.9,0.7L2.9,0.7c1.4,0,2.6,1.2,2.6,2.6v115c0,1.4-1.2,2.6-2.6,2.6l0,0c-1.4,0-2.6-1.2-2.6-2.6V3.3C0.3,1.9,1.4,0.7,2.9,0.7z', show: false,
width: 5, position: 'center'
length: '70%',
offsetCenter: [0, '8%']
}, },
progress: { emphasis: {
show: true, label: {
overlap: true, show: true,
roundCap: true fontSize: 40,
fontWeight: 'bold'
}
}, },
axisLine: { labelLine: {
roundCap: true show: false
}, },
data: [ data: [
{ { value: this.height, name: '高危' },
value: this.height, { value: this.medium, name: '中危' },
name: '高危', { value: this.low, name: '低危' }
title: { ]
offsetCenter: ['-40%', '80%']
},
detail: {
offsetCenter: ['-40%', '95%']
}
},
{
value: this.medium,
name: '中危',
title: {
offsetCenter: ['0%', '80%']
},
detail: {
offsetCenter: ['0%', '95%']
}
},
{
value: this.low,
name: '低危',
title: {
offsetCenter: ['40%', '80%']
},
detail: {
offsetCenter: ['40%', '95%']
}
}
],
title: {
fontSize: 14
},
detail: {
width: 40,
height: 14,
fontSize: 14,
color: '#fff',
backgroundColor: 'inherit',
borderRadius: 3,
formatter: '{value}%'
}
} }
] ]
} }
// const option = {
// title: {
// text: '用例风险程度概览',
// left: 'left',
// textStyle: {
// color: '#606266',
// fontWeight: 700,
// fontSize: 16
// }
// },
// color: ['#E55868', '#F6B24B', '#1A6FD7'],
// series: [
// {
// type: 'gauge',
// anchor: {
// show: true,
// showAbove: true,
// size: 18,
// itemStyle: {
// color: '#FAC858'
// }
// },
// pointer: {
// icon: 'path://M2.9,0.7L2.9,0.7c1.4,0,2.6,1.2,2.6,2.6v115c0,1.4-1.2,2.6-2.6,2.6l0,0c-1.4,0-2.6-1.2-2.6-2.6V3.3C0.3,1.9,1.4,0.7,2.9,0.7z',
// width: 5,
// length: '70%',
// offsetCenter: [0, '8%']
// },
// progress: {
// show: true,
// overlap: true,
// roundCap: true
// },
// axisLine: {
// roundCap: true
// },
// data: [
// {
// value: this.height,
// name: '高危',
// title: {
// offsetCenter: ['-40%', '80%']
// },
// detail: {
// offsetCenter: ['-40%', '95%']
// }
// },
// {
// value: this.medium,
// name: '中危',
// title: {
// offsetCenter: ['0%', '80%']
// },
// detail: {
// offsetCenter: ['0%', '95%']
// }
// },
// {
// value: this.low,
// name: '低危',
// title: {
// offsetCenter: ['40%', '80%']
// },
// detail: {
// offsetCenter: ['40%', '95%']
// }
// }
// ],
// title: {
// fontSize: 14
// },
// detail: {
// width: 40,
// height: 14,
// fontSize: 14,
// color: '#fff',
// backgroundColor: 'inherit',
// borderRadius: 3,
// formatter: '{value}%'
// }
// }
// ]
// }
// 4.传入数据 // 4.传入数据
this.chart.setOption(option) this.chart.setOption(option)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment