| | |
| | | export default { |
| | | data() { |
| | | //这里存放数据 |
| | | return {}; |
| | | return { myChart }; |
| | | }, |
| | | //方法集合 |
| | | methods: { |
| | | gaugeChart1() { |
| | | var legendData = ["人员", "变更后人员"]; //图例 |
| | | var legendData = ['人员', '变更后人员']; //图例 |
| | | |
| | | var indicator = [ |
| | | { name: "中缅天然气管道风险排查航空摄影测量", max: 80 }, |
| | | { name: "唐山LNG", max: 80 }, |
| | | { name: "中俄东线管道工程南段", max: 160 }, |
| | | { name: '中缅天然气管道风险排查航空摄影测量', max: 80 }, |
| | | { name: '唐山LNG', max: 80 }, |
| | | { name: '中俄东线管道工程南段', max: 160 }, |
| | | |
| | | { name: "中俄东线管道工程中段", max: 100 }, |
| | | { name: "新疆连木沁站场", max: 40 }, |
| | | { name: "广州站", max: 40 }, |
| | | { name: '中俄东线管道工程中段', max: 100 }, |
| | | { name: '新疆连木沁站场', max: 40 }, |
| | | { name: '广州站', max: 40 }, |
| | | ]; |
| | | var dataArr = [ |
| | | { |
| | |
| | | itemStyle: { |
| | | normal: { |
| | | lineStyle: { |
| | | color: "#4A99FF", |
| | | color: '#4A99FF', |
| | | // shadowColor: '#4A99FF', |
| | | // shadowBlur: 10, |
| | | }, |
| | | shadowColor: "#4A99FF", |
| | | shadowColor: '#4A99FF', |
| | | shadowBlur: 10, |
| | | }, |
| | | }, |
| | |
| | | normal: { |
| | | // 单项区域填充样式 |
| | | color: { |
| | | type: "linear", |
| | | type: 'linear', |
| | | x: 0, //右 |
| | | y: 0, //下 |
| | | x2: 1, //左 |
| | |
| | | colorStops: [ |
| | | { |
| | | offset: 0, |
| | | color: "#4A99FF", |
| | | color: '#4A99FF', |
| | | }, |
| | | { |
| | | offset: 0.5, |
| | | color: "rgba(0,0,0,0)", |
| | | color: 'rgba(0,0,0,0)', |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: "#4A99FF", |
| | | color: '#4A99FF', |
| | | }, |
| | | ], |
| | | globalCoord: false, |
| | |
| | | itemStyle: { |
| | | normal: { |
| | | lineStyle: { |
| | | color: "#4BFFFC", |
| | | color: '#4BFFFC', |
| | | // shadowColor: '#4BFFFC', |
| | | // shadowBlur: 10, |
| | | }, |
| | | shadowColor: "#4BFFFC", |
| | | shadowColor: '#4BFFFC', |
| | | shadowBlur: 10, |
| | | }, |
| | | }, |
| | |
| | | normal: { |
| | | // 单项区域填充样式 |
| | | color: { |
| | | type: "linear", |
| | | type: 'linear', |
| | | x: 0, //右 |
| | | y: 0, //下 |
| | | x2: 1, //左 |
| | |
| | | colorStops: [ |
| | | { |
| | | offset: 0, |
| | | color: "#4BFFFC", |
| | | color: '#4BFFFC', |
| | | }, |
| | | { |
| | | offset: 0.5, |
| | | color: "rgba(0,0,0,0)", |
| | | color: 'rgba(0,0,0,0)', |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: "#4BFFFC", |
| | | color: '#4BFFFC', |
| | | }, |
| | | ], |
| | | globalCoord: false, |
| | |
| | | }, |
| | | }, |
| | | ]; |
| | | var colorArr = ["#4A99FF", "#4BFFFC"]; //颜色 |
| | | var colorArr = ['#4A99FF', '#4BFFFC']; //颜色 |
| | | let option = { |
| | | title: { |
| | | // show: false, |
| | | text: "人员变动", |
| | | text: '人员变动', |
| | | // x: "4%", |
| | | textStyle: { |
| | | color: "#fff", |
| | | color: '#fff', |
| | | // fontSize: "22", |
| | | }, |
| | | // subtextStyle: { |
| | |
| | | |
| | | color: colorArr, |
| | | legend: { |
| | | orient: "vertical", |
| | | icon: "circle", //图例形状 |
| | | orient: 'vertical', |
| | | icon: 'circle', //图例形状 |
| | | data: legendData, |
| | | top: 0, |
| | | right: 0, |
| | |
| | | itemGap: 21, // 图例每项之间的间隔。[ default: 10 ]横向布局时为水平间隔,纵向布局时为纵向间隔。 |
| | | textStyle: { |
| | | fontSize: 12, |
| | | color: "#00E4FF", |
| | | color: '#00E4FF', |
| | | }, |
| | | }, |
| | | radar: { |
| | | // shape: 'circle', |
| | | name: { |
| | | textStyle: { |
| | | color: "#fff", |
| | | color: '#fff', |
| | | fontSize: 12, |
| | | }, |
| | | }, |
| | |
| | | show: true, |
| | | areaStyle: { |
| | | // 分隔区域的样式设置。 |
| | | color: ["rgba(255,255,255,0)", "rgba(255,255,255,0)"], // 分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。 |
| | | color: ['rgba(255,255,255,0)', 'rgba(255,255,255,0)'], // 分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。 |
| | | }, |
| | | }, |
| | | axisLine: { |
| | | //指向外圈文本的分隔线样式 |
| | | lineStyle: { |
| | | color: "#153269", |
| | | color: '#153269', |
| | | }, |
| | | }, |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: "#113865", // 分隔线颜色 |
| | | color: '#113865', // 分隔线颜色 |
| | | width: 1, // 分隔线线宽 |
| | | }, |
| | | }, |
| | | }, |
| | | series: [ |
| | | { |
| | | type: "radar", |
| | | type: 'radar', |
| | | symbolSize: 4, |
| | | // symbol: 'angle', |
| | | data: dataArr, |
| | |
| | | ], |
| | | }; |
| | | |
| | | let myChart = this.$echarts.init(document.getElementById("echart43")); |
| | | myChart.setOption(option); |
| | | window.addEventListener("resize", function () { |
| | | myChart.resize(); |
| | | this.myChart = this.$echarts.init(document.getElementById('echart43')); |
| | | this.myChart.setOption(option); |
| | | window.addEventListener('resize', function () { |
| | | this.myChart.resize(); |
| | | }); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.gaugeChart1(); |
| | | this.$bus.$on('resizeEchart', (res) => { |
| | | this.myChart.resize(); |
| | | }); |
| | | }, |
| | | }; |
| | | </script> |