|
|
@@ -5,9 +5,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import * as echarts from 'echarts'
|
|
|
|
|
|
export default {
|
|
|
- name: 'SyjhdxqkChart',
|
|
|
+ name: 'Dlydtssx',
|
|
|
data() {
|
|
|
return {
|
|
|
option: {}
|
|
|
@@ -19,7 +20,6 @@ export default {
|
|
|
|
|
|
methods: {
|
|
|
getOption() {
|
|
|
-
|
|
|
const data = [{
|
|
|
name: '第一季度',
|
|
|
value: 40
|
|
|
@@ -40,19 +40,19 @@ export default {
|
|
|
})
|
|
|
const colors = [
|
|
|
[
|
|
|
- new echarts.graphic.LinearGradient(0, 1, 0, 0, [{ offset: 0, color: 'rgb(82, 113, 195)' }, {
|
|
|
+ new echarts.graphic.LinearGradient(0, 1, 0, 0, [{offset: 0, color: 'rgb(82, 113, 195)'}, {
|
|
|
offset: 1,
|
|
|
color: 'rgb(120, 142, 237)'
|
|
|
}], false),
|
|
|
- new echarts.graphic.LinearGradient(0, 1, 0, 0, [{ offset: 0, color: 'rgb(81, 129, 192)' }, {
|
|
|
+ new echarts.graphic.LinearGradient(0, 1, 0, 0, [{offset: 0, color: 'rgb(81, 129, 192)'}, {
|
|
|
offset: 1,
|
|
|
color: 'rgb(123, 148, 234)'
|
|
|
}], false),
|
|
|
- new echarts.graphic.LinearGradient(0, 1, 0, 0, [{ offset: 0, color: 'rgb(89, 137, 188)' }, {
|
|
|
+ new echarts.graphic.LinearGradient(0, 1, 0, 0, [{offset: 0, color: 'rgb(89, 137, 188)'}, {
|
|
|
offset: 1,
|
|
|
color: 'rgb(113, 173, 229)'
|
|
|
}], false),
|
|
|
- new echarts.graphic.LinearGradient(0, 1, 0, 0, [{ offset: 0, color: 'rgb(88, 166, 191)' }, {
|
|
|
+ new echarts.graphic.LinearGradient(0, 1, 0, 0, [{offset: 0, color: 'rgb(88, 166, 191)'}, {
|
|
|
offset: 1,
|
|
|
color: 'rgb(128, 230, 226)'
|
|
|
}], false)
|
|
|
@@ -72,8 +72,8 @@ export default {
|
|
|
type: 'pie',
|
|
|
clockWise: false, // 顺时加载
|
|
|
hoverAnimation: false, // 鼠标移入变大
|
|
|
- radius: [90 - i * 10 + '%', 86 - i * 10 + '%'],
|
|
|
- center: ['50%', '50%'],
|
|
|
+ radius: [90 - i * 15 + '%', 84 - i * 15 + '%'],
|
|
|
+ center: ['45%', '50%'],
|
|
|
label: {
|
|
|
show: false
|
|
|
},
|
|
|
@@ -91,19 +91,19 @@ export default {
|
|
|
value: data[i].value,
|
|
|
name: data[i].name
|
|
|
},
|
|
|
- {
|
|
|
- value: sum - data[i].value,
|
|
|
- name: '',
|
|
|
- itemStyle: {
|
|
|
- color: 'transparent',
|
|
|
- borderRadius: 60 // 设置每一段子项目的圆角
|
|
|
+ {
|
|
|
+ value: sum - data[i].value,
|
|
|
+ name: '',
|
|
|
+ itemStyle: {
|
|
|
+ color: 'transparent',
|
|
|
+ borderRadius: 60 // 设置每一段子项目的圆角
|
|
|
|
|
|
- },
|
|
|
- tooltip: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- hoverAnimation: false
|
|
|
- }
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ hoverAnimation: false
|
|
|
+ }
|
|
|
]
|
|
|
})
|
|
|
series.push({
|
|
|
@@ -113,8 +113,8 @@ export default {
|
|
|
z: 1,
|
|
|
clockWise: false, // 顺时加载
|
|
|
hoverAnimation: false, // 鼠标移入变大
|
|
|
- radius: [90 - i * 10 + '%', 86 - i * 10 + '%'],
|
|
|
- center: ['50%', '50%'],
|
|
|
+ radius: [90 - i * 15 + '%', 84 - i * 15 + '%'],
|
|
|
+ center: ['45%', '50%'],
|
|
|
label: {
|
|
|
show: false
|
|
|
},
|
|
|
@@ -138,32 +138,31 @@ export default {
|
|
|
},
|
|
|
hoverAnimation: false
|
|
|
},
|
|
|
- {
|
|
|
- value: 2.5,
|
|
|
- itemStyle: {
|
|
|
- color: 'rgba(0,0,0,0)',
|
|
|
- borderWidth: 0,
|
|
|
- borderRadius: 60 // 设置每一段子项目的圆角
|
|
|
- },
|
|
|
- tooltip: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- hoverAnimation: false
|
|
|
- }
|
|
|
+ {
|
|
|
+ value: 2.5,
|
|
|
+ itemStyle: {
|
|
|
+ color: 'rgba(0,0,0,0)',
|
|
|
+ borderWidth: 0,
|
|
|
+ borderRadius: 60 // 设置每一段子项目的圆角
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ hoverAnimation: false
|
|
|
+ }
|
|
|
]
|
|
|
})
|
|
|
- yAxis.push(((data[i].value / sum) * 100).toFixed(2) + '%')
|
|
|
+ yAxis.push(((data[i].value / sum) * 100).toFixed(0) + '%')
|
|
|
}
|
|
|
this.option = {
|
|
|
- backgroundColor: '#012248',
|
|
|
color: colors[0],
|
|
|
legend: {
|
|
|
show: true,
|
|
|
icon: 'circle',
|
|
|
- top: '15%',
|
|
|
+ top: '2%',
|
|
|
left: '60%',
|
|
|
- width: '40%',
|
|
|
- height: '60%',
|
|
|
+ width: '100%',
|
|
|
+ height: '100%',
|
|
|
data: name,
|
|
|
orient: 'vertical',
|
|
|
formatter: (name) => {
|
|
|
@@ -178,7 +177,7 @@ export default {
|
|
|
title: {
|
|
|
fontSize: 14,
|
|
|
lineHeight: 30,
|
|
|
- color: 'rgb(0, 178, 246)'
|
|
|
+ color: '#ffffff'
|
|
|
},
|
|
|
value: {
|
|
|
fontSize: 14,
|
|
|
@@ -195,10 +194,10 @@ export default {
|
|
|
},
|
|
|
grid: {
|
|
|
top: '3%',
|
|
|
- left: '50%',
|
|
|
+ left: '40%',
|
|
|
width: '40%',
|
|
|
- height: '21%',
|
|
|
- containLabel: false
|
|
|
+ height: '30%',
|
|
|
+ containLabel: true
|
|
|
},
|
|
|
yAxis: [{
|
|
|
type: 'category',
|
|
|
@@ -211,7 +210,9 @@ export default {
|
|
|
},
|
|
|
axisLabel: {
|
|
|
interval: 0,
|
|
|
+ left: 30,
|
|
|
inside: true,
|
|
|
+
|
|
|
textStyle: {
|
|
|
color: '#fff',
|
|
|
fontSize: 14
|
|
|
@@ -225,7 +226,6 @@ export default {
|
|
|
}],
|
|
|
series: series
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|