-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.html
168 lines (168 loc) · 4.39 KB
/
home.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="./home.css" />
</head>
<body>
<div class="all">
<div class="page1 page">
<div calss="locationpage">
<img
style="width: 20px"
class="location"
src="./src/images/location.png"
alt=""
/>
<span>重庆</span>
</div>
<img class="bg02" src="./src/images/bg02.png" alt="" />
<img class="bg03" src="./src/images/bg03.png" alt="" />
<img class="bg04" src="./src/images/bg04.png" alt="" />
</div>
<div class="page2 page"></div>
<div class="page3 page"></div>
<div class="page4 page">
<div class="chart"></div>
</div>
<div class="page5 page"></div>
<div class="footer"></div>
</div>
<div class="searchPage">
<div class="top">
<input placeholder="搜索地区" type="text" />
<button>确定</button>
</div>
<p>热门城市</p>
<div class="city"></div>
</div>
</body>
<script type="module" src="./home.js"></script>
<script src="node_modules/echarts/dist/echarts.min.js"></script>
<script>
(function () {
//图表
let myChart = echarts.init(document.querySelector(".chart"));
var option = {
grid: {
show: true,
backgroundColor: "transparent",
opacity: 0.3,
borderWidth: "0",
top: "50",
bottom: "0",
},
/* tooltip: {
trigger: "axis",
}, */
legend: {
show: false,
},
xAxis: [
// 星期
{
type: "category",
boundaryGap: false,
position: "top",
offset: 20,
zlevel: 100,
axisLine: {
show: false,
},
axisTick: {
show: false,
},
axisLabel: {
interval: 0,
formatter: ["{a|{value}}"].join("\n"),
rich: {
a: {
// color: 'white',
fontSize: 14,
},
},
},
nameTextStyle: {
fontWeight: "bold",
fontSize: 19,
},
data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
},
],
yAxis: {
type: "value",
show: false,
axisLabel: {
formatter: "{value} °C",
color: "white",
},
},
series: [
{
name: "最高气温",
type: "line",
data: ["16.3", "16.2", "17.6", "14.2", "17.6", "15.7", "14.3"],
symbol: "emptyCircle",
symbolSize: 10,
showSymbol: true,
smooth: true,
itemStyle: {
normal: {
color: "#C95843",
},
},
label: {
show: true,
position: "top",
// color: 'white',
formatter: "{c} °C",
},
lineStyle: {
width: 1,
// color: 'white'
},
areaStyle: {
opacity: 1,
color: "transparent",
},
},
{
name: "最低气温",
type: "line",
data: ["13.4", "12.8", "13.5", "12.5", "12.4", "13.2", "13"],
symbol: "emptyCircle",
symbolSize: 10,
showSymbol: true,
smooth: true,
itemStyle: {
normal: {
color: "blue",
},
},
label: {
show: true,
position: "bottom",
// color: 'white',
formatter: "{c} °C",
},
lineStyle: {
width: 1,
// color: 'white'
},
areaStyle: {
opacity: 1,
color: "transparent",
},
},
],
};
myChart.setOption(option);
window.addEventListener("resize", function () {
myChart.resize();
});
})();
</script>
</html>