Commit 950baf62 authored by 张俊's avatar 张俊

环图样式

parent 3ee34dd7
...@@ -40,6 +40,7 @@ export default { ...@@ -40,6 +40,7 @@ export default {
methods: { methods: {
init_health(num, color, text) { init_health(num, color, text) {
var options = { var options = {
color:[color,'#c9cedd'],
title: { title: {
text: num + "%", text: num + "%",
textStyle: { textStyle: {
...@@ -96,48 +97,79 @@ export default { ...@@ -96,48 +97,79 @@ export default {
}, },
series: [ series: [
{ {
type: "bar", type: 'pie',
silent: true, z:5,
data: [ center:['50%','50%'],
{ radius:['68%','72%'],
name: "作文得分", silent:true,
value: num, label: {
itemStyle: { normal: {
normal: { show: false
color: color, },
shadowColor: "rgba(0, 0, 0, 0.2)", emphasis: {
shadowBlur: 20 show: false
} }
} },
} labelLine: {
], normal: {
coordinateSystem: "polar", show: false
roundCap: true, },
barWidth: 8, emphasis: {
barGap: "-100%", // 两环重叠 show: false
}
z: 2 },
}, tooltip: {
show: false
},
data:[{
name:'',
value:num
},{
name:'',
value:100 - num
}]
},
{ {
// 灰色环 type:'pie',
type: "bar", z:4,
silent: true, center:['50%','50%'],
data: [ radius:['60%','80%'],
{ hoverAnimation:false,
value: 100, avoidLabelOverlap: false,
itemStyle: { label: {
color: "#c9cedd", normal: {
shadowColor: "rgba(0, 0, 0, 0.2)", show: false
shadowBlur: 20 },
} emphasis: {
} show: false
], }
coordinateSystem: "polar", },
roundCap: true, labelLine: {
barWidth: 8, normal: {
barGap: "-100%", // 两环重叠 show: false
z: 1 },
} emphasis: {
show: false
}
},
tooltip: {
show: false
},
itemStyle: {
normal: {
color:'#f6f7fc'
}
},
emphasis:{
show:false,
itemStyle:{
color:'#f6f7fc'
}
},
data: [{
value: 1,
}],
}
] ]
}; };
window[this.health] = echarts.init(document.getElementById(this.health)); window[this.health] = echarts.init(document.getElementById(this.health));
......
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