js.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942
  1.  $(window).load(function(){
  2. $(".loading").fadeOut()
  3. })
  4. $(function () {
  5. echarts_21();
  6. echarts_22();
  7. echarts_1();
  8. echarts_2();
  9. echarts_3();
  10. echarts_4();
  11. echarts_5();
  12. function echarts_21() {
  13. // 基于准备好的dom,初始化echarts实例
  14. var myChart = echarts.init(document.getElementById('echart21'));
  15. option1 = {
  16. tooltip: {
  17. trigger: 'axis',
  18. axisPointer: { type: 'shadow'}
  19. },
  20. grid: {
  21. left: '0%',
  22. top:'10px',
  23. right: '0%',
  24. bottom: '0px',
  25. containLabel: true
  26. },
  27. xAxis: [{
  28. type: 'category',
  29. data: ['1', '2', '3', '4', '5','6', '7', '8', '9', '10','11', '12'],
  30. axisLine: {
  31. show: true,
  32. lineStyle: {
  33. color: "rgba(255,255,255,.1)",
  34. width: 1,
  35. type: "solid"
  36. },
  37. },
  38. axisTick: {
  39. show: false,
  40. },
  41. axisLabel: {
  42. interval: 0,
  43. // rotate:50,
  44. show: true,
  45. splitNumber: 15,
  46. textStyle: {
  47. color: "rgba(255,255,255,.6)",
  48. fontSize: '12',
  49. },
  50. },
  51. }],
  52. yAxis: [{
  53. type: 'value',
  54. axisLabel: {
  55. //formatter: '{value} %'
  56. show:true,
  57. textStyle: {
  58. color: "rgba(255,255,255,.6)",
  59. fontSize: '12',
  60. },
  61. },
  62. axisTick: {
  63. show: false,
  64. },
  65. axisLine: {
  66. show: true,
  67. lineStyle: {
  68. color: "rgba(255,255,255,.1 )",
  69. width: 1,
  70. type: "solid"
  71. },
  72. },
  73. splitLine: {
  74. lineStyle: {
  75. color: "rgba(255,255,255,.1)",
  76. }
  77. }
  78. }],
  79. series: [
  80. {
  81. type: 'line',
  82. data: [5030, 8600, 3000,7200,7200, 5130, 10030, 8600, 13000,7200, 9130, 4130],
  83. itemStyle: {
  84. normal: {
  85. color:'#37a3ff',
  86. opacity: 1,
  87. BorderRadius: 3,
  88. }
  89. }
  90. }
  91. ]
  92. };
  93. // 使用刚指定的配置项和数据显示图表。
  94. myChart.setOption(option1);
  95. window.addEventListener("resize",function(){
  96. myChart.resize();
  97. });
  98. }
  99. function echarts_22() {
  100. // 基于准备好的dom,初始化echarts实例
  101. var myChart = echarts.init(document.getElementById('echart22'));
  102. option1 = {
  103. // backgroundColor: '#00265f',
  104. tooltip: {
  105. trigger: 'axis',
  106. axisPointer: { type: 'shadow'}
  107. },
  108. grid: {
  109. left: '0%',
  110. top:'5px',
  111. right: '0%',
  112. bottom: '0px',
  113. containLabel: true
  114. },
  115. xAxis: [{
  116. type: 'category',
  117. data: ['1', '2', '3', '4', '5','6', '7', '8', '9', '10','11', '12'],
  118. axisLine: {
  119. show: true,
  120. lineStyle: {
  121. color: "rgba(255,255,255,.1)",
  122. width: 1,
  123. type: "solid"
  124. },
  125. },
  126. axisTick: {
  127. show: false,
  128. },
  129. axisLabel: {
  130. interval: 0,
  131. // rotate:50,
  132. show: true,
  133. splitNumber: 15,
  134. textStyle: {
  135. color: "rgba(255,255,255,.6)",
  136. fontSize: '12',
  137. },
  138. },
  139. }],
  140. yAxis: [{
  141. type: 'value',
  142. axisLabel: {
  143. //formatter: '{value} %'
  144. show:true,
  145. textStyle: {
  146. color: "rgba(255,255,255,.6)",
  147. fontSize: '12',
  148. },
  149. },
  150. axisTick: {
  151. show: false,
  152. },
  153. axisLine: {
  154. show: true,
  155. lineStyle: {
  156. color: "rgba(255,255,255,.1 )",
  157. width: 1,
  158. type: "solid"
  159. },
  160. },
  161. splitLine: {
  162. lineStyle: {
  163. color: "rgba(255,255,255,.1)",
  164. }
  165. }
  166. }],
  167. series: [
  168. {
  169. type: 'line',
  170. data: [7200, 9130, 5030, 8600, 3000,7200, 4130, 5130, 10030, 8600, 13000,7200],
  171. itemStyle: {
  172. normal: {
  173. color:'#37a3ff',
  174. opacity: 1,
  175. barBorderRadius: 3,
  176. }
  177. }
  178. }
  179. ]
  180. };
  181. // 使用刚指定的配置项和数据显示图表。
  182. myChart.setOption(option1);
  183. window.addEventListener("resize",function(){
  184. myChart.resize();
  185. });
  186. }
  187. function echarts_1() {
  188. // 基于准备好的dom,初始化echarts实例
  189. var myChart = echarts.init(document.getElementById('feng01'));
  190. var gauge_value=66;
  191. option = {
  192. title: {
  193. x: "center",
  194. bottom: 10,
  195. //text: '风向',
  196. subtext: '风向',
  197. textStyle: {
  198. fontWeight: 'normal',
  199. fontSize: 18,
  200. color: "#fff"
  201. },
  202. },
  203. tooltip: {
  204. show: true,
  205. },
  206. series: [
  207. {
  208. type: 'gauge',
  209. radius:'60%',
  210. center: ['50%', '55%'],
  211. splitNumber: 7, //刻度数量
  212. min: 0,
  213. max:70,
  214. startAngle: 225,
  215. endAngle: -45,
  216. axisLine: {
  217. show: true,
  218. lineStyle: {
  219. width: 2,
  220. shadowBlur: 0,
  221. color: [
  222. [1, '#8f8f8f']
  223. ]
  224. }
  225. },
  226. axisTick: {
  227. show: false,
  228. lineStyle: {
  229. color: '#8f8f8f',
  230. width: 1
  231. },
  232. length: -5,
  233. splitNumber: 7
  234. },
  235. splitLine: {
  236. show: true,
  237. length: -5,
  238. lineStyle: {
  239. color: "rgba(255,255,255,.2)",
  240. }
  241. },
  242. axisLabel: {
  243. distance: -25,
  244. formatter: function(e) {
  245. switch(e + "") {
  246. case "0":
  247. return "北风";
  248. case "10":
  249. return "东北风";
  250. case "20":
  251. return "东风";
  252. case "30":
  253. return "东南风";
  254. case "40":
  255. return "南风";
  256. case "50":
  257. return "西南风";
  258. case "60":
  259. return "西风";
  260. case "70":
  261. return "西北风";
  262. default:
  263. return e;
  264. }
  265. },
  266. textStyle: {
  267. fontSize: 10,
  268. color: "rgba(255,255,255,.6)",
  269. }
  270. },
  271. pointer: { //仪表盘指针
  272. show: 0
  273. },
  274. detail: {
  275. show: false
  276. },
  277. data: [{
  278. name: "",
  279. value: 100
  280. }]
  281. } ,
  282. {
  283. name: '风向',
  284. type: 'gauge',
  285. startAngle: 225,
  286. endAngle: -45,
  287. radius: '56%',
  288. center: ['50%', '55%'], // 默认全局居中
  289. min: 0,
  290. max: 100,
  291. axisLine: {
  292. show: false,
  293. lineStyle: {
  294. width:5,
  295. shadowBlur: 0,
  296. color: [
  297. [1, '#82b440']
  298. ]
  299. }
  300. },
  301. axisTick: {
  302. show: false,
  303. },
  304. splitLine: {
  305. show: false,
  306. length: 20,
  307. },
  308. axisLabel: {
  309. show:false
  310. },
  311. pointer: {
  312. show: true,
  313. length: '65%',
  314. width: 4
  315. },
  316. detail: {
  317. show:false,
  318. offsetCenter: [0, 0],
  319. textStyle: {
  320. fontSize: 10
  321. }
  322. },
  323. itemStyle: {
  324. normal: {
  325. color: "#82b440",
  326. }
  327. },
  328. data: [{
  329. name: "",
  330. value: Math.floor(gauge_value)
  331. }]
  332. }]
  333. };
  334. // 使用刚指定的配置项和数据显示图表。
  335. myChart.setOption(option);
  336. window.addEventListener("resize",function(){
  337. myChart.resize();
  338. });
  339. }
  340. function echarts_2() {
  341. // 基于准备好的dom,初始化echarts实例
  342. var myChart = echarts.init(document.getElementById('feng02'));
  343. var gauge_value=30;
  344. option = {
  345. title: {
  346. x: "center",
  347. bottom: 0,
  348. text: gauge_value,
  349. subtext: '风速km/h',
  350. textStyle: {
  351. fontWeight: 'normal',
  352. fontSize: 18,
  353. color: "#fff"
  354. },
  355. },
  356. tooltip: {
  357. show: true,
  358. },
  359. series: [
  360. {
  361. type: 'gauge',
  362. radius:'60%',
  363. center: ['50%', '55%'],
  364. splitNumber: 7, //刻度数量
  365. min: 0,
  366. max:70,
  367. startAngle: 225,
  368. endAngle: -45,
  369. axisLine: {
  370. show: true,
  371. lineStyle: {
  372. width: 2,
  373. shadowBlur: 0,
  374. color: [
  375. [1, '#8f8f8f']
  376. ]
  377. }
  378. },
  379. axisTick: {
  380. show: false,
  381. lineStyle: {
  382. color: '#8f8f8f',
  383. width: 1
  384. },
  385. length: -5,
  386. splitNumber: 7
  387. },
  388. splitLine: {
  389. show: true,
  390. length: -5,
  391. lineStyle: {
  392. color: "rgba(255,255,255,.2)",
  393. }
  394. },
  395. axisLabel: {
  396. distance: -15,
  397. textStyle: {
  398. fontSize: 10,
  399. color: "rgba(255,255,255,.6)",
  400. }
  401. },
  402. pointer: { //仪表盘指针
  403. show: 0
  404. },
  405. detail: {
  406. show: false
  407. },
  408. data: [{
  409. name: "",
  410. value: 100
  411. }]
  412. } ,
  413. {
  414. name: '风向',
  415. type: 'gauge',
  416. startAngle: 225,
  417. endAngle: -45,
  418. radius: '56%',
  419. center: ['50%', '55%'], // 默认全局居中
  420. min: 0,
  421. max: 70,
  422. axisLine: {
  423. show: false,
  424. lineStyle: {
  425. width:5,
  426. shadowBlur: 0,
  427. color: [
  428. [1, '#2ea7ff']
  429. ]
  430. }
  431. },
  432. axisTick: {
  433. show: false,
  434. },
  435. splitLine: {
  436. show: false,
  437. length: 20,
  438. },
  439. axisLabel: {
  440. show:false
  441. },
  442. pointer: {
  443. show: true,
  444. length: '65%',
  445. width: 4
  446. },
  447. detail: {
  448. show:false,
  449. offsetCenter: [0, 0],
  450. textStyle: {
  451. fontSize: 10
  452. }
  453. },
  454. itemStyle: {
  455. normal: {
  456. color: "#2ea7ff",
  457. }
  458. },
  459. data: [{
  460. name: "",
  461. value: Math.floor(gauge_value)
  462. }]
  463. }]
  464. };
  465. // 使用刚指定的配置项和数据显示图表。
  466. myChart.setOption(option);
  467. window.addEventListener("resize",function(){
  468. myChart.resize();
  469. });
  470. }
  471. function echarts_3() {
  472. // 基于准备好的dom,初始化echarts实例
  473. var myChart = echarts.init(document.getElementById('feng03'));
  474. var gauge_value=17;
  475. option = {
  476. title: {
  477. x: "center",
  478. bottom: 0,
  479. text:gauge_value,
  480. subtext: '降雨量ML',
  481. textStyle: {
  482. fontWeight: 'normal',
  483. fontSize: 18,
  484. color: "#fff"
  485. },
  486. },
  487. tooltip: {
  488. show: true,
  489. },
  490. series: [
  491. {
  492. type: 'gauge',
  493. radius:'60%',
  494. center: ['50%', '55%'],
  495. splitNumber: 10, //刻度数量
  496. min: 0,
  497. max:100,
  498. startAngle: 225,
  499. endAngle: -45,
  500. axisLine: {
  501. show: true,
  502. lineStyle: {
  503. width: 2,
  504. shadowBlur: 0,
  505. color: [
  506. [1, '#8f8f8f']
  507. ]
  508. }
  509. },
  510. axisTick: {
  511. show: false,
  512. lineStyle: {
  513. color: "rgba(255,255,255,.1)",
  514. width: 1
  515. },
  516. length: -5,
  517. splitNumber: 7
  518. },
  519. splitLine: {
  520. show: true,
  521. length: -5,
  522. lineStyle: {
  523. color: "rgba(255,255,255,.2)",
  524. }
  525. },
  526. axisLabel: {
  527. distance: -15,
  528. textStyle: {
  529. fontSize: 10,
  530. color: "rgba(255,255,255,.6)",
  531. }
  532. },
  533. pointer: { //仪表盘指针
  534. show: 0
  535. },
  536. detail: {
  537. show: false
  538. },
  539. data: [{
  540. name: "",
  541. value: 100
  542. }]
  543. } ,
  544. {
  545. name: '风向',
  546. type: 'gauge',
  547. startAngle: 225,
  548. endAngle: -45,
  549. radius: '56%',
  550. center: ['50%', '55%'], // 默认全局居中
  551. min: 0,
  552. max: 100,
  553. axisLine: {
  554. show: false,
  555. lineStyle: {
  556. width:5,
  557. shadowBlur: 0,
  558. color: [
  559. [1, '#ff7109']
  560. ]
  561. }
  562. },
  563. axisTick: {
  564. show: false,
  565. },
  566. splitLine: {
  567. show: false,
  568. length: 20,
  569. },
  570. axisLabel: {
  571. show:false
  572. },
  573. pointer: {
  574. show: true,
  575. length: '65%',
  576. width: 4
  577. },
  578. detail: {
  579. show:false,
  580. offsetCenter: [0, 0],
  581. textStyle: {
  582. fontSize: 10
  583. }
  584. },
  585. itemStyle: {
  586. normal: {
  587. color: "#ff7109",
  588. }
  589. },
  590. data: [{
  591. name: "",
  592. value: Math.floor(gauge_value)
  593. }]
  594. }]
  595. };
  596. // 使用刚指定的配置项和数据显示图表。
  597. myChart.setOption(option);
  598. window.addEventListener("resize",function(){
  599. myChart.resize();
  600. });
  601. }
  602. function echarts_4() {
  603. // 基于准备好的dom,初始化echarts实例
  604. var myChart = echarts.init(document.getElementById('echart4'));
  605. option = {
  606. tooltip: {
  607. trigger: 'axis',
  608. axisPointer: {type: 'shadow'},
  609. },"grid": {
  610. "top": "20%",
  611. "right":"50",
  612. "bottom":"20",
  613. "left":"30",
  614. },
  615. legend: {
  616. data: ['数据1', '数据2', '数据3','增幅'],
  617. right: 'center', width:'100%',
  618. textStyle: {
  619. color: "rgba(255,255,255,.5)"
  620. },
  621. itemWidth: 12,
  622. itemHeight: 10,
  623. },
  624. "xAxis": [
  625. {
  626. "type": "category",
  627. data: ['2016', '2017', '2018', '2019'],
  628. axisLine:{ show: false,},
  629. axisLabel: { textStyle: {
  630. fontSize:14,
  631. color: "rgba(255,255,255,.5)",
  632. },
  633. },
  634. },
  635. ],
  636. "yAxis": [
  637. {
  638. "type": "value",
  639. // "name": "单位万",
  640. axisTick: {show: false},
  641. splitLine: { show: false,},
  642. axisLine: { show: false,},
  643. "axisLabel": {
  644. "show": true,
  645. fontSize:14,
  646. color: "rgba(255,255,255,.5)"
  647. },
  648. axisLine: {
  649. min:0,
  650. max:10,
  651. show:false
  652. },//左线色
  653. },
  654. {
  655. "type": "value",
  656. //"name": "增速",
  657. "show": true,
  658. "axisLabel": {
  659. formatter: "{value} %",
  660. fontSize:14,
  661. color: "rgba(255,255,255,.5)"},
  662. axisTick: {show: false},
  663. splitNumber:3,
  664. axisLine: {show:false},//右线色
  665. splitLine: {lineStyle: {color:'rgba(255,255,255,.05)'}},//x轴线
  666. },
  667. ],
  668. "series": [
  669. {
  670. "name": "数据1",
  671. "type": "bar",
  672. "data": [36.6,38.80, 40.84, 41.60],
  673. "barWidth": "10%",
  674. "itemStyle": {
  675. "normal": {
  676. barBorderRadius:15,
  677. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  678. offset: 0,
  679. color: '#8bd46e'
  680. }, {
  681. offset: 1,
  682. color: '#09bcb7'
  683. }]),
  684. }
  685. },
  686. "barGap": "0.2"
  687. },
  688. {
  689. "name": "数据2",
  690. "type": "bar",
  691. "data":[14.8,14.1, 15, 16.30],
  692. "barWidth": "10%",
  693. "itemStyle": {
  694. "normal": {
  695. barBorderRadius: 15,
  696. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  697. offset: 0,
  698. color: '#248ff7'
  699. }, {
  700. offset: 1,
  701. color: '#6851f1'
  702. }]),
  703. }
  704. },
  705. "barGap": "0.2"
  706. },
  707. {
  708. "name": "数据3",
  709. "type": "bar",
  710. "data":[9.2,9.1, 9.85, 8.9],
  711. "barWidth": "10%",
  712. "itemStyle": {
  713. "normal": {
  714. barBorderRadius: 15,
  715. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  716. offset: 0,
  717. color: '#fccb05'
  718. }, {
  719. offset: 1,
  720. color: '#f5804d'
  721. }]),
  722. }
  723. },
  724. "barGap": "0.2"
  725. }
  726. ,
  727. {
  728. "name": "增幅",
  729. "type": "line",
  730. "yAxisIndex": 1,
  731. "data": [3, 1, 5,2.3],
  732. lineStyle: {
  733. normal: {
  734. width: 2
  735. },
  736. },
  737. "itemStyle": {
  738. "normal": {
  739. "color": "#3496f8",
  740. }
  741. },
  742. // "smooth": true,
  743. symbolSize:0,
  744. }
  745. ]
  746. };
  747. // 使用刚指定的配置项和数据显示图表。
  748. myChart.setOption(option);
  749. window.addEventListener("resize",function(){
  750. myChart.resize();
  751. });
  752. }
  753. function echarts_5() {
  754. // 基于准备好的dom,初始化echarts实例
  755. var myChart = echarts.init(document.getElementById('echart5'));
  756. var lightBlue = {
  757. type: 'linear',
  758. x: 0,
  759. y: 0,
  760. x2: 0,
  761. y2: 1,
  762. colorStops: [{
  763. offset: 0,
  764. color: 'rgba(41, 121, 255, 1)'
  765. }, {
  766. offset: 1,
  767. color: 'rgba(0, 192, 255, 1)'
  768. }],
  769. globalCoord: false
  770. }
  771. var option = {
  772. tooltip: {
  773. show: false
  774. },
  775. grid: {
  776. top: '0%',
  777. left: '50',
  778. right: '50',
  779. bottom: '0%',
  780. },
  781. xAxis: {
  782. min: 0,
  783. //max: 12000,
  784. splitLine: {
  785. show: false
  786. },
  787. axisTick: {
  788. show: false
  789. },
  790. axisLine: {
  791. show: false
  792. },
  793. axisLabel: {
  794. show: false
  795. }
  796. },
  797. yAxis: {
  798. data: ['数据','数据','数据','数据','数据','数据'],
  799. //offset: 15,
  800. axisTick: {
  801. show: false
  802. },
  803. axisLine: {
  804. show: false
  805. },
  806. axisLabel: {
  807. color: 'rgba(255,255,255,.6)',
  808. fontSize: 14,
  809. }
  810. },
  811. series: [{
  812. type: 'bar',
  813. label: {
  814. show: true,
  815. zlevel: 10000,
  816. position: 'right',
  817. padding: 6,
  818. color: '#4e84a1',
  819. fontSize: 14,
  820. formatter: '{c}'
  821. },
  822. itemStyle: {
  823. barBorderRadius: 25,
  824. color:'#3facff'
  825. },
  826. barWidth: '15',
  827. data: [ 1800, 1240, 1168, 1200, 2336, 1680],
  828. z: 6
  829. }
  830. ],
  831. };
  832. // 使用刚指定的配置项和数据显示图表。
  833. myChart.setOption(option);
  834. window.addEventListener("resize",function(){
  835. myChart.resize();
  836. });
  837. }
  838. })