管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-01-16 21ddc9ec1b1b76d2ce20e512328e65acaf1af2bf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<template>
  <div class="systemMonitoring_box">
    <div id="echart43"></div>
  </div>
</template>
 
<script>
export default {
  data() {
    //这里存放数据
    return { myChart: null, };
  },
  //方法集合
  methods: {
    gaugeChart1() {
      var legendData = ['人员', '变更后人员']; //图例
 
      var indicator = [
        { name: '中缅天然气管道风险排查航空摄影测量', max: 80 },
        { name: '唐山LNG', max: 80 },
        { name: '中俄东线管道工程南段', max: 160 },
 
        { name: '中俄东线管道工程中段', max: 100 },
        { name: '新疆连木沁站场', max: 40 },
        { name: '广州站', max: 40 },
      ];
      var dataArr = [
        {
          value: [35, 30, 80, 70, 15, 15],
          name: legendData[0],
          itemStyle: {
            normal: {
              lineStyle: {
                color: '#4A99FF',
                // shadowColor: '#4A99FF',
                // shadowBlur: 10,
              },
              shadowColor: '#4A99FF',
              shadowBlur: 10,
            },
          },
          areaStyle: {
            normal: {
              // 单项区域填充样式
              color: {
                type: 'linear',
                x: 0, //右
                y: 0, //下
                x2: 1, //左
                y2: 1, //上
                colorStops: [
                  {
                    offset: 0,
                    color: '#4A99FF',
                  },
                  {
                    offset: 0.5,
                    color: 'rgba(0,0,0,0)',
                  },
                  {
                    offset: 1,
                    color: '#4A99FF',
                  },
                ],
                globalCoord: false,
              },
              opacity: 1, // 区域透明度
            },
          },
          //在拐点处显示数值
          label: {
            show: true,
            formatter: function (params) {
              return params.value;
            },
          },
        },
        {
          value: [40, 25, 110, 60, 18, 12],
          name: legendData[1],
          itemStyle: {
            normal: {
              lineStyle: {
                color: '#4BFFFC',
                // shadowColor: '#4BFFFC',
                // shadowBlur: 10,
              },
              shadowColor: '#4BFFFC',
              shadowBlur: 10,
            },
          },
          areaStyle: {
            normal: {
              // 单项区域填充样式
              color: {
                type: 'linear',
                x: 0, //右
                y: 0, //下
                x2: 1, //左
                y2: 1, //上
                colorStops: [
                  {
                    offset: 0,
                    color: '#4BFFFC',
                  },
                  {
                    offset: 0.5,
                    color: 'rgba(0,0,0,0)',
                  },
                  {
                    offset: 1,
                    color: '#4BFFFC',
                  },
                ],
                globalCoord: false,
              },
              opacity: 1, // 区域透明度
            },
          },
          //在拐点处显示数值
          label: {
            show: true,
            formatter: function (params) {
              return params.value;
            },
          },
        },
      ];
      var colorArr = ['#4A99FF', '#4BFFFC']; //颜色
      let option = {
        title: {
          // show: false,
          text: '人员变动',
          top: 15,
          // x: "4%",
          textStyle: {
            color: '#fff',
            // fontSize: "22",
          },
          // subtextStyle: {
          //   color: "#90979c",
          //   fontSize: "16",
          // },
        },
        // 图表的位置
        // grid: {
        //   position: "center",
        // },
 
        color: colorArr,
        legend: {
          orient: 'vertical',
          icon: 'circle', //图例形状
          data: legendData,
          top: 0,
          right: 0,
          itemWidth: 14, // 图例标记的图形宽度。[ default: 25 ]
          itemHeight: 14, // 图例标记的图形高度。[ default: 14 ]
          itemGap: 21, // 图例每项之间的间隔。[ default: 10 ]横向布局时为水平间隔,纵向布局时为纵向间隔。
          textStyle: {
            fontSize: 12,
            color: '#00E4FF',
          },
        },
        radar: {
          // shape: 'circle',
          name: {
            textStyle: {
              color: '#fff',
              fontSize: 12,
            },
          },
          radius: 75,
          nameGap: 2, // 图中工艺等字距离图的距离
          splitNumber: 4, // 网格线的个数
          center: ["50%", "63%"], // 图的位置
 
          indicator: indicator,
          splitArea: {
            // 坐标轴在 grid 区域中的分隔区域,默认不显示。
            show: true,
            areaStyle: {
              // 分隔区域的样式设置。
              color: ['rgba(255,255,255,0)', 'rgba(255,255,255,0)'], // 分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。
            },
          },
          axisLine: {
            //指向外圈文本的分隔线样式
            lineStyle: {
              color: '#153269',
            },
          },
          splitLine: {
            lineStyle: {
              color: '#113865', // 分隔线颜色
              width: 1, // 分隔线线宽
            },
          },
        },
        series: [
          {
            type: 'radar',
            symbolSize: 4,
            // symbol: 'angle',
            data: dataArr,
          },
        ],
      };
 
      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>
<style lang="less" scoped>
//@import url(); 引入公共css类
.systemMonitoring_box {
  padding: 20px;
  width: 100%;
  height: 100%;
 
  #echart43 {
    width: calc(100% - 40px);
    height: calc(100% - 40px);
  }
}
</style>