1
Surpriseplus
2022-09-16 8d1a91c23df335b090e38b2edd15203aa3b03da9
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
<template>
  <div class="left5">
    <div class="title">
      <span>产业发展</span>
      <img class="img" src="../../../assets/img/zonlan (9).png" alt="" />
    </div>
    <div id="main"></div>
  </div>
</template>
 
<script>
import * as echarts from "echarts";
export default {
  name: "left5",
  mounted() {
    this.echarts();
  },
  methods: {
    echarts() {
      var chartDom = document.getElementById("main");
      var myChart = echarts.init(chartDom);
      var option;
 
      option = {
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "cross",
            crossStyle: {
              color: "#fff",
            },
          },
        },
        toolbox: {
          feature: {
            // dataView: { show: true, readOnly: false },
            magicType: { show: true, type: ["line", "bar"] },
            restore: { show: true },
            saveAsImage: { show: true },
          },
        },
        legend: {
          data: [
            "第一产业",
            "第二产业",
            "第三产业",
            "第一产业1",
            "第二产业2",
            "第三产业3",
          ],
          itemWidth: 8,
          itemHeight: 5,
          textStyle: {
            color: "#fff",
            fontSize: "32",
          },
        },
        xAxis: [
          {
            type: "category",
            data: [
              "1月",
              "2月",
              "3月",
              "4月",
              "5月",
              "6月",
              "7月",
              "8月",
              "9月",
              "10月",
              "11月",
              "12月",
            ],
            axisPointer: {
              type: "shadow",
            },
            axisLabel: {
              textStyle: {
                color: "#fff", //设置x轴标签文字颜色
                fontSize: "24",
              },
            },
            axisLine: {
              lineStyle: {
                color: "#C1C1C1", //设置x轴线颜色
              },
            },
          },
        ],
        yAxis: [
          {
            type: "value",
            name: "亿元",
            min: 0,
            max: 250,
            interval: 50,
 
            axisLine: {
              lineStyle: {
                color: "#C1C1C1", //设置x轴线颜色
              },
            },
            axisLabel: {
              formatter: "{value}",
              textStyle: {
                color: "#fff", //设置y轴标签文字颜色
                fontSize: "28",
              },
            },
          },
          {
            type: "value",
            name: "百分比",
            min: 0,
            max: 25,
            interval: 5,
            axisLabel: {
              formatter: "{value}",
              textStyle: {
                color: "#fff", //设置y轴标签文字颜色
                fontSize: "28",
              },
            },
          },
        ],
        series: [
          {
            name: "第一产业",
            type: "bar",
            color: "#0177DB",
            data: [
              2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4,
              3.3,
            ],
          },
          {
            name: "第二产业",
            type: "bar",
            color: "#01D873",
            data: [
              2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0,
              2.3,
            ],
          },
          {
            name: "第三产业",
            type: "bar",
            yAxisIndex: 1,
            color: "#E0CF02",
            data: [
              2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2,
            ],
          },
          {
            name: "第一产业1",
            type: "line",
            data: [
              42.0, 3.9, 7.0, 53.2, 25.6, 74.7, 235.6, 122.2, 38.6, 60.0, 6.4,
              3.3,
            ],
          },
          {
            name: "第二产业2",
            type: "line",
            data: [
              2.8, 6.9, 8.0, 25.4, 38.7, 50.7, 275.6, 172.2, 42.7, 28.8, 8.0,
              2.3,
            ],
          },
          {
            name: "第三产业3",
            type: "line",
            yAxisIndex: 1,
            data: [
              8.0, 2.2, 5.3, 6.5, 6.3, 20.2, 20.3, 33.4, 23.0, 16.5, 12.0, 6.2,
            ],
          },
        ],
      };
 
      option && myChart.setOption(option);
    },
  },
};
</script>
 
<style lang="less" scoped>
.left5 {
  box-sizing: border-box;
  overflow: hidden;
  width: 100%;
  height: 35%;
  .title {
    width: 100%;
    position: relative;
    img {
      width: 100%;
    }
    span {
      font-size: 75px;
      font-weight: 400;
      color: #ffe86b;
      background: linear-gradient(0deg, #bce7ff 0%, #69efff 98.6572265625%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      position: absolute;
      left: 50%;
      top: 0;
      transform: translateX(-50%);
    }
  }
  #main {
    width: 100%;
    height: 90%;
  }
}
</style>