| | |
| | | components: {}, |
| | | data() { |
| | | //这里存放数据 |
| | | return {}; |
| | | return { myChart }; |
| | | }, |
| | | mounted() { |
| | | this.lineChart(); |
| | | this.$bus.$on('resizeEchart', (res) => { |
| | | this.myChart.resize(); |
| | | }); |
| | | }, |
| | | //方法集合 |
| | | methods: { |
| | | lineChart() { |
| | | let option = { |
| | | title: { |
| | | text: "各项目总体进度", |
| | | text: '各项目总体进度', |
| | | textStyle: { |
| | | color: "#fff", |
| | | color: '#fff', |
| | | }, |
| | | }, |
| | | tooltip: { |
| | | trigger: "item", |
| | | trigger: 'item', |
| | | }, |
| | | // legend: {}, |
| | | grid: { |
| | | left: "3%", |
| | | right: "4%", |
| | | bottom: "3%", |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true, |
| | | }, |
| | | series: [ |
| | | { |
| | | name: "各项目总体进度", |
| | | type: "pie", |
| | | radius: ["40%", "70%"], |
| | | roseType: "radius", |
| | | color: ["#03effb", "#00bec4", "#3a82ab"], |
| | | name: '各项目总体进度', |
| | | type: 'pie', |
| | | radius: ['40%', '70%'], |
| | | roseType: 'radius', |
| | | color: ['#03effb', '#00bec4', '#3a82ab'], |
| | | avoidLabelOverlap: false, |
| | | itemStyle: { |
| | | fontColor: "fff", |
| | | borderColor: "#fff", |
| | | fontColor: 'fff', |
| | | borderColor: '#fff', |
| | | }, |
| | | label: { |
| | | show: false, |
| | | position: "center", |
| | | position: 'center', |
| | | }, |
| | | emphasis: { |
| | | // label: { |
| | |
| | | show: false, |
| | | }, |
| | | data: [ |
| | | { value: 4, name: "已完成" }, |
| | | { value: 7, name: "进行中" }, |
| | | { value: 8, name: "未开始" }, |
| | | { value: 4, name: '已完成' }, |
| | | { value: 7, name: '进行中' }, |
| | | { value: 8, name: '未开始' }, |
| | | ], |
| | | }, |
| | | ], |
| | | }; |
| | | let myChart = this.$echarts.init(document.getElementById("echart44")); |
| | | myChart.setOption(option); |
| | | window.addEventListener("resize", function () { |
| | | myChart.resize(); |
| | | this.myChart = this.$echarts.init(document.getElementById('echart44')); |
| | | this.myChart.setOption(option); |
| | | window.addEventListener('resize', function () { |
| | | this.myChart.resize(); |
| | | }); |
| | | }, |
| | | }, |