2023西安数博会CIM演示-【前端】-Web
AdaKing88
2023-08-21 bc03b832caa49bbcd2674fe4cae3701b5059bf95
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
<template>
   <div class="publicToilets">
      <div class="header">
         <span class="title1">24时全景区游客及安保配置</span>
      </div>
      <div class="echartsTool">
         <chart :optionIn="option1" />
      </div>
   </div>
</template>
 
<script>
   import * as echarts from 'echarts';
   import chart from "@/components/chart.vue";
   export default {
      name: "TimeNumber",
      data() {
         return {
            option1: {}
         }
      },
      components: {
         chart
      },
      mounted() {
         this.option1 = {
            // backgroundColor: '#000',
            grid: {
               top: '35px',
               right: '0px',
               bottom: '0px',
               left: '0px',
               containLabel: true
            },
            legend: {
               data: [
                  {
                     name: '安保',
                     textStyle: {
                        color: '#fff'
                     },
                     itemStyle: {
                        color: '#40E0D0',
                        borderWidth: 6,
                        borderColor: '#44D7B6'
                     }
                  },
                  {
                     name: '游客',
                     textStyle: {
                        color: '#fff'
                     },
                     itemStyle: {
                        color: '#63B8FF'
                     }
                  }
               ],
               icon: 'rect',
               itemWidth: 40,
               itemHeight: 1,
               itemGap: 40,
               top: '-5px',
            },
            // dataZoom: [
            //     {
            //       show: true,
            //       realtime: true,
            //       height:6,
            //       start: 0,
            //       end: 80,
            //     },
            //   ],
            xAxis: {
               data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
               axisLabel: {
                  color: '#fff',
                  interval: index => [0, 9, 19, 29].includes(index)
               },
               axisTick: {
                  show: false
               },
               axisLine: {
                  lineStyle: {
                     color: 'rgba(222, 222, 222, 0.44)',
                     width: 1.5
                  }
               }
            },
            yAxis: [
               {
                  type: 'value',
                  splitNumber: 4,
                  axisLabel: {
                     color: '#fff'
                  },
                  axisTick: {
                     show: false
                  },
                  axisLine: {
                     show: false,
                     lineStyle: {
                        color: 'rgba(255, 255, 255, 0.44)',
                        width: 1.5
                     }
                  },
                  splitLine: {
                     lineStyle: {
                        color: 'rgba(222,222,222,0.36)',
                        type: 'dashed'
                     }
                  },
                  name: '(人)',
                  nameGap: 18,
                  nameTextStyle: {
                     fontSize: 10,
                     color: '#fff',
                     padding: [0, 0, 0, -30]
                  }
               },
               {
                  type: 'value',
                  splitNumber: 2,
                  splitLine: {
                     show: false
                  },
                  axisLabel: {
                     color: '#fff'
                  },
                  name: '(万人)',
                  nameGap: 18,
                  nameTextStyle: {
                     fontSize: 10,
                     color: '#fff',
                     padding: [0, 0, 0, 30]
                  }
               }
            ],
            series: [
               {
                  name: '安保',
                  yAxisIndex: 0,
                  type: 'bar',
                  data: [2000, 1000, 1000, 500, 500, 500, 500, 1000, 3000, 5000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 5000, 3000, 3000],
                  itemStyle: {
                     normal: {
                        color: '#40E0D0'
                     }
                  }
               },
               {
                  name: '游客',
                  yAxisIndex: 1,
                  type: 'line',
                  data: [100, 100, 100, 50, 20, 20, 20, 50, 100, 300, 400, 500, 600, 700, 800, 800, 800, 700, 600, 700, 800, 900, 600, 500, 300],
                  symbol: 'none',
                  lineStyle: {
                     color: '#63B8FF'
                  },
               }
            ]
         }
      },
   }
 
 
 
</script>
 
<style lang="scss" scoped>
   .publicToilets {
      width: 100%;
      height: 33%;
      display: flex;
      flex-direction: column;
      align-items: center;
 
      .echartsTool {
         width: calc(100% - 40px);
         height: 100%;
         margin-top: 20px;
      }
 
      .header {
         width: 304px;
         height: 27.5px;
         margin-left: 20px;
         margin-top: 20px;
         background-image: url("~@/assets/img/menuTitle1.png");
         background-repeat: no-repeat;
         background-size: 100% 100%;
         font-family: PangMenZhengDao;
         text-shadow: 0px 6px 9px #20618e;
         display: flex;
         flex-direction: row;
         align-items: center;
         flex-shrink: 0;
         align-self: flex-start;
 
         .title1 {
            margin-left: 30px;
            font-size: 15px;
            color: #ffffff;
         }
      }
   }
</style>