quanyawei
2024-02-01 f70d875a462fdb80807eae2bd022d5a3173a6e05
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
<template>
  <div class="dashboard-container">
    <div class="dashboard-text">此处为下钻地图</div>
    <div id="main" style="width: 100%;height:400px;display:flex;justify-content: center;" />
    <el-button @click="go">进入主页</el-button>
  </div>
</template>
 
<script>
 
export default {
  name: 'Dashboard',
  mounted() {
    this.drawChart()
  },
  methods: {
    go() {
      this.$router.push('/main/index')
    },
    drawChart() {
      const myChart = this.$echarts.init(document.getElementById('main'))
      var option = {
        color: ['#2db7f5', '#00ff7f'],
        title: {
          text: 'O3-1H' + '  ' + this.time
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          data: ['预测', '实测']
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        toolbox: {
          feature: {
            saveAsImage: {}
          }
        },
        xAxis: {
          type: 'category',
          axisLabel: {
            interval: 0
          },
          boundaryGap: false,
          data: ['01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00', '次日00:00']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            name: '预测',
            type: 'line',
            label: {
              normal: {
                show: true,
                position: 'top'
              }
            },
            itemStyle: {
              normal: {
                lineStyle: {
                  color: '#2db7f5'
                }
              }
            },
            data: this.o31hDataYuce
          },
          {
            name: '实测',
            type: 'line',
            label: {
              normal: {
                show: true,
                position: 'top'
              }
            },
            itemStyle: {
              normal: {
                lineStyle: {
                  color: '#00ff7f'
                }
              }
            },
            data: this.o31hDataShice
          }
        ]
      }
      myChart.setOption(option)
    }
  }
}
</script>
 
<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>