survey.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  7. <link rel="stylesheet" href="style/reset.css" />
  8. <link rel="stylesheet" href="style/public.css" />
  9. <link rel="stylesheet" href="style/survey.css" />
  10. <link rel="stylesheet" href="font/iconfont.css" />
  11. <title>Document</title>
  12. </head>
  13. <body>
  14. <header class="title">
  15. <i class="iconfont iconwenzhangguanli"></i>
  16. 江门概况
  17. </header>
  18. <div class="line"></div>
  19. <section class="s1">
  20. <div class="s-title"><h2>地理环境</h2></div>
  21. <p class="describe">
  22. 江门,别称“五邑”,是广东省地级市,喂鱼珠江三角洲西部,濒临南海,毗邻港澳,属粤港澳大湾区城市群,是珠江三角洲西部地区的中心城市之一,“中国舞蹈之城”,“中国侨都”。
  23. </p>
  24. </section>
  25. <div class="line"></div>
  26. <section class="s2">
  27. <div class="card xingzheng">
  28. <div class="s-title"><h2>行政区划</h2></div>
  29. <p>下辖<span class="emphasize">3</span>个区</p>
  30. <p>代管<span class="emphasize">4</span>个县级市</p>
  31. <div class="f-item">
  32. <p><span class="emphasize">61</span>个镇</p>
  33. <p><span class="emphasize">12</span>个街道</p>
  34. </div>
  35. <div class="f-item">
  36. <p><span class="emphasize">1050</span>个村</p>
  37. <p><span class="emphasize">275</span>个社区</p>
  38. </div>
  39. </div>
  40. <div class="card qihoulvyou">
  41. <div class="s-title"><h2>气候概况</h2></div>
  42. <div class="f-item">
  43. <span>全年降雨量</span>
  44. <span class="emphasize">1990.0mm</span>
  45. </div>
  46. <div class="f-item">
  47. <span>全年平均温度</span>
  48. <span class="emphasize">23.1℃</span>
  49. </div>
  50. <div class="f-item">
  51. <span>历史最高气温</span>
  52. <span class="emphasize">38℃</span>
  53. </div>
  54. <div class="f-item">
  55. <span>历史最低气温</span>
  56. <span class="emphasize">5℃</span>
  57. </div>
  58. </div>
  59. <div class="line"></div>
  60. <div class="card" id="people"></div>
  61. <div class="card" id="people-tree"></div>
  62. <div class="line"></div>
  63. <div class="card jiaotong-body">
  64. <div class="s-title"><h2>交通路况</h2></div>
  65. <div class="jiaotongcon">
  66. <div class="fix-item">
  67. <span>交通指数</span>
  68. <div id="zhishu">3.4</div>
  69. </div>
  70. <div class="fix-item">
  71. <span>平均车速</span>
  72. <div id="chesu">32.8km/h</div>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="card qihoulvyou">
  77. <div class="s-title"><h2>旅游概况</h2></div>
  78. <div class="f-item">
  79. <span>旅游景点</span>
  80. <span class="classifier"><span class="emphasize">70</span>个</span>
  81. </div>
  82. <div class="f-item">
  83. <span>旅游机构</span>
  84. <span class="classifier"><span class="emphasize">183</span>个</span>
  85. </div>
  86. <div class="f-item">
  87. <span>旅游宾馆</span>
  88. <span class="classifier"><span class="emphasize">899</span>家</span>
  89. </div>
  90. <div class="f-item">
  91. <span>旅游收入合计</span>
  92. <span class="classifier"><span class="emphasize">492.53</span>亿元</span>
  93. </div>
  94. </div>
  95. </section>
  96. <script src="js/echarts.min.js"></script>
  97. <script>
  98. (function() {
  99. let option = {
  100. title: {
  101. text: "户籍总人口",
  102. textStyle: {
  103. color: "#fff"
  104. }
  105. },
  106. color: ["#ffe354"],
  107. tooltip: {
  108. trigger: "axis",
  109. axisPointer: {
  110. // 坐标轴指示器,坐标轴触发有效
  111. type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
  112. }
  113. },
  114. grid: {
  115. left: "3%",
  116. right: "4%",
  117. bottom: "3%",
  118. containLabel: true,
  119. borderColor: "#fff"
  120. },
  121. xAxis: [
  122. {
  123. type: "category",
  124. data: ["2013", "2014", "2015", "2016", "2017"],
  125. axisTick: {
  126. alignWithLabel: true
  127. },
  128. axisLine: {
  129. lineStyle: {
  130. color: "#ffffff"
  131. }
  132. }
  133. }
  134. ],
  135. yAxis: [
  136. {
  137. name: "(万人)",
  138. type: "value",
  139. boundaryGap: true,
  140. min: 390,
  141. splitLine: {
  142. show: false
  143. },
  144. axisLine: {
  145. lineStyle: {
  146. color: "#ffffff"
  147. }
  148. }
  149. }
  150. ],
  151. series: [
  152. {
  153. name: "人口",
  154. type: "bar",
  155. barWidth: "40%",
  156. data: [393, 393.5, 391.5, 393.8, 396.3]
  157. }
  158. ]
  159. };
  160. let treeOption = {
  161. title: {
  162. text: "户籍自然增长率",
  163. textStyle: {
  164. color: "#fff"
  165. }
  166. },
  167. color: ["#ff9a32", "#ffe354"],
  168. tooltip: {
  169. trigger: "axis",
  170. axisPointer: {
  171. // 坐标轴指示器,坐标轴触发有效
  172. type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
  173. }
  174. },
  175. grid: {
  176. left: "3%",
  177. right: "4%",
  178. bottom: "3%",
  179. top: "20%",
  180. containLabel: true,
  181. borderColor: "#fff"
  182. },
  183. legend: {
  184. itemWidth: 14,
  185. itemHeight: 5,
  186. itemGap: 1,
  187. data: ["自然增长人数(人)", "自然增长率(%)"],
  188. x: "55%",
  189. textStyle: {
  190. color: "#fff",
  191. fontSize: 10
  192. }
  193. },
  194. xAxis: {
  195. data: ["2013", "2014", "2015", "2016", "2017"],
  196. axisLine: {
  197. lineStyle: {
  198. color: "#ffffff"
  199. }
  200. },
  201. axisTick: {
  202. show: false //隐藏X轴刻度
  203. },
  204. axisLabel: {
  205. show: true,
  206. textStyle: {
  207. color: "#fff" //X轴文字颜色
  208. }
  209. }
  210. },
  211. yAxis: [
  212. {
  213. type: "value",
  214. splitLine: {
  215. show: false
  216. },
  217. splitLine: {
  218. show: false
  219. },
  220. axisTick: {
  221. show: false
  222. },
  223. axisLine: {
  224. lineStyle: {
  225. color: "#ffffff"
  226. }
  227. },
  228. axisLabel: {
  229. show: true,
  230. textStyle: {
  231. color: "#fff"
  232. }
  233. }
  234. },
  235. {
  236. type: "value",
  237. position: "right",
  238. splitLine: {
  239. show: false
  240. },
  241. axisTick: {
  242. show: false
  243. },
  244. axisLine: {
  245. lineStyle: {
  246. color: "#ffffff"
  247. }
  248. },
  249. axisLabel: {
  250. show: true,
  251. formatter: "{value} %", //右侧Y轴文字显示
  252. textStyle: {
  253. color: "#fff"
  254. }
  255. }
  256. }
  257. ],
  258. series: [
  259. {
  260. name: "自然增长率(%)",
  261. type: "line",
  262. yAxisIndex: 1, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
  263. smooth: true, //平滑曲线显示
  264. showAllSymbol: true, //显示所有图形。
  265. symbol: "circle", //标记的图形为实心圆
  266. symbolSize: 10, //标记的大小
  267. data: [0.39, 0.23, 0.57, 0.74, 0.67]
  268. },
  269. {
  270. name: "自然增长人数(人)",
  271. type: "bar",
  272. data: [15232, 9092, 22431, 28824, 26452]
  273. }
  274. ]
  275. };
  276. // let treeOption = {
  277. // title: {
  278. // text: "人口",
  279. // textStyle: {
  280. // color: "#fff"
  281. // }
  282. // },
  283. // color: ["#ffe354", "#ff9a32"],
  284. // tooltip: {
  285. // trigger: "axis",
  286. // axisPointer: {
  287. // // 坐标轴指示器,坐标轴触发有效
  288. // type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
  289. // },
  290. // formatter: function(params) {
  291. // // 改鼠标悬浮提示值格式
  292. // var relVal = params[0].name + "<br/>";
  293. // relVal +=
  294. // params[0].seriesName + " : " + params[0].value + "<br/>";
  295. // relVal +=
  296. // params[1].seriesName + " : " + -params[1].value + "<br/>";
  297. // return relVal;
  298. // }
  299. // },
  300. // legend: {
  301. // data: ["男", "女"]
  302. // },
  303. // grid: {
  304. // left: "2%",
  305. // right: "4%",
  306. // bottom: "3%",
  307. // containLabel: true
  308. // },
  309. // xAxis: [
  310. // {
  311. // type: "value",
  312. // axisLabel: {
  313. // formatter: function(value) {
  314. // if (value < 0) {
  315. // return -value;
  316. // } else {
  317. // return value;
  318. // }
  319. // }
  320. // },
  321. // axisLine: {
  322. // lineStyle: {
  323. // color: "#ffffff"
  324. // }
  325. // }
  326. // }
  327. // ],
  328. // yAxis: [
  329. // {
  330. // name: "(万/人)",
  331. // position: "left",
  332. // type: "category",
  333. // axisTick: { show: false },
  334. // axisLine: {
  335. // show: true,
  336. // lineStyle: {
  337. // color: "#ffffff"
  338. // }
  339. // },
  340. // data: ["100", "200", "300", "400", "500", "600", "700"]
  341. // }
  342. // ],
  343. // series: [
  344. // {
  345. // name: "男",
  346. // type: "bar",
  347. // stack: "总量",
  348. // label: {
  349. // normal: {
  350. // show: true,
  351. // position: "right"
  352. // }
  353. // },
  354. // data: [320, 302, 241, 274, 290, 320, 302]
  355. // },
  356. // {
  357. // name: "女",
  358. // type: "bar",
  359. // stack: "总量",
  360. // label: {
  361. // normal: {
  362. // show: true,
  363. // position: "left",
  364. // formatter: function(value) {
  365. // if (value.data < 0) {
  366. // return -value.data;
  367. // }
  368. // }
  369. // }
  370. // },
  371. // data: [-120, -132, -101, -134, -190, -200, -210]
  372. // }
  373. // ]
  374. // };
  375. let peopleChart = echarts.init(document.querySelector("#people"));
  376. let treeChart = echarts.init(document.querySelector("#people-tree"));
  377. peopleChart.setOption(option);
  378. treeChart.setOption(treeOption);
  379. })();
  380. Array.from(document.querySelectorAll(".s2 .card")).forEach(
  381. (dom, index) => {
  382. dom.addEventListener("click", e => {
  383. console.log("surveyClickHandle", index);
  384. window.surveyClickHandle && window.surveyClickHandle(index)
  385. });
  386. }
  387. );
  388. let $zhishu = document.getElementById("zhishu");
  389. let $chesu = document.getElementById("chesu");
  390. setInterval(() => {
  391. $zhishu.innerHTML = ((Math.random() + 2) * 3).toFixed(1);
  392. $chesu.innerHTML = ((Math.random() + 1) * 30).toFixed(1) + "km/h";
  393. }, 2000);
  394. </script>
  395. </body>
  396. </html>