js.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879
  1. 
  2. /****/
  3. $(document).ready(function(){
  4. var whei=$(window).width()
  5. $("html").css({fontSize:whei/20})
  6. $(window).resize(function(){
  7. var whei=$(window).width()
  8. $("html").css({fontSize:whei/20})
  9. });
  10. });
  11. $(window).load(function(){$(".loading").fadeOut()})
  12. $(function () {
  13. echarts_1()
  14. echarts_2()
  15. echarts_3()
  16. pe04()
  17. pe01()
  18. pe02()
  19. pe03()
  20. function echarts_4() {
  21. var myChart = echarts.init(document.getElementById('echarts4'));
  22. var data = [{
  23. "name": "邮件总量",
  24. "value": 20000
  25. }, {
  26. "name": "公文交换",
  27. "value": 18170
  28. }, {
  29. "name": "内部流转",
  30. "value": 19870
  31. } ]
  32. option = {
  33. color: ['#A0CE3A', '#31C5C0', '#1E9BD1', '#0F347B', '#585247', '#7F6AAD', '#009D85', "rgba(250,250,250,0.3)"],
  34. grid: {
  35. bottom: 0,
  36. left: 0,
  37. right: '0'
  38. },
  39. series: [
  40. // 主要展示层的
  41. {
  42. radius: ['30%', '50%'],
  43. center: ['50%', '50%'],
  44. type: 'pie',
  45. label: {
  46. normal: {
  47. show: true,
  48. formatter: ['{b|{b}}','{c|{c}次}', '{d|同比:{d}%}'].join('\n'),
  49. rich: {
  50. c: {
  51. color: 'rgb(241,246,104)',
  52. fontSize: 20,
  53. fontWeight:'bold',
  54. lineHeight: 25
  55. },
  56. b: {
  57. color: 'rgb(98,137,169)',
  58. fontSize: 15,
  59. height: 40
  60. },
  61. },
  62. position: 'outside'
  63. },
  64. emphasis: {
  65. show: true
  66. }
  67. },
  68. labelLine: {
  69. normal: {
  70. show: true,
  71. length: 15,
  72. length2: 50
  73. },
  74. emphasis: {
  75. show: true
  76. }
  77. },
  78. name: "民警训练总量",
  79. data: data,
  80. },
  81. // 边框的设置
  82. {
  83. radius: ['30%', '35%'],
  84. center: ['50%', '50%'],
  85. type: 'pie',
  86. label: {
  87. normal: {
  88. show: false
  89. },
  90. emphasis: {
  91. show: false
  92. }
  93. },
  94. labelLine: {
  95. normal: {
  96. show: false
  97. },
  98. emphasis: {
  99. show: false
  100. }
  101. },
  102. animation: false,
  103. tooltip: {
  104. show: false
  105. },
  106. data: [{
  107. value: 1,
  108. itemStyle: {
  109. color: "rgba(250,250,250,0.3)",
  110. },
  111. }],
  112. }, {
  113. name: '外边框',
  114. type: 'pie',
  115. clockWise: false, //顺时加载
  116. hoverAnimation: false, //鼠标移入变大
  117. center: ['50%', '50%'],
  118. radius: ['60%', '61%'],
  119. label: {
  120. normal: {
  121. show: false
  122. }
  123. },
  124. data: [{
  125. value: 9,
  126. name: '',
  127. itemStyle: {
  128. normal: {
  129. borderWidth: 2,
  130. borderColor: '#0c2c69'
  131. }
  132. }
  133. }]
  134. },
  135. ]
  136. };
  137. myChart.setOption(option);
  138. window.addEventListener("resize",function(){
  139. myChart.resize();
  140. });
  141. }
  142. function echarts_1() {
  143. var myChart = echarts.init(document.getElementById('echarts1'));
  144. option = {
  145. tooltip: {
  146. trigger: 'axis',
  147. axisPointer: {type: 'shadow'},
  148. },
  149. legend: {
  150. x: 'center',
  151. y: '0',
  152. icon: 'circle',
  153. itemGap:8,
  154. textStyle: {color: 'rgba(255,255,255,.5)'},
  155. itemWidth: 10,
  156. itemHeight: 10,
  157. },
  158. grid: {
  159. left: '0',
  160. top: '30',
  161. right: '15',
  162. bottom: '0',
  163. containLabel: true
  164. },
  165. xAxis: {
  166. type: 'category',
  167. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
  168. axisLine: {show:false},
  169. axisLabel: {
  170. textStyle: {
  171. color:'rgba(255,255,255,.6)',
  172. fontSize:14
  173. }
  174. },
  175. },
  176. yAxis: {
  177. type: 'value',
  178. splitNumber:4,
  179. axisLine: { show: false },
  180. axisTick: {show: false},
  181. splitLine: {
  182. show: true,
  183. lineStyle: {
  184. color: 'rgba(255,255,255,0.05)'
  185. }
  186. },
  187. axisLabel: {
  188. textStyle: {
  189. color:'rgba(255,255,255,.6)',
  190. fontSize:14
  191. },
  192. },
  193. },
  194. series: [ {
  195. name: '字段1',
  196. type: 'bar',
  197. barWidth: '15%',
  198. itemStyle: {
  199. normal: {
  200. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  201. offset: 0,
  202. color: '#8bd46e'
  203. }, {
  204. offset: 1,
  205. color: '#03b48e'
  206. }]),
  207. barBorderRadius: 11,
  208. }
  209. },
  210. data: [123,154, 234, 321,120,390, 634,123,154, 234, 321, 108]
  211. },
  212. {
  213. name: '字段2',
  214. type: 'bar',
  215. barWidth: '15%',
  216. itemStyle: {
  217. normal: {
  218. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  219. offset: 0,
  220. color: '#3893e5'
  221. }, {
  222. offset: 1,
  223. color: '#248ff7'
  224. }]),
  225. barBorderRadius: 11,
  226. }
  227. },
  228. data: [63,194, 234, 321,278,110, 534,63,194, 234, 321,278]
  229. },
  230. {
  231. name: '字段3',
  232. type: 'bar',
  233. barWidth: '15%',
  234. itemStyle: {
  235. normal: {
  236. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  237. offset: 0,
  238. color: '#43cadd'
  239. }, {
  240. offset: 1,
  241. color: '#0097c9'
  242. }]),
  243. barBorderRadius: 11,
  244. }
  245. },
  246. data: [23,354, 334, 221,178,190, 234,354, 334, 221,178,190]
  247. }
  248. ]
  249. };
  250. myChart.setOption(option);
  251. window.addEventListener("resize",function(){
  252. myChart.resize();
  253. });
  254. }
  255. function echarts_2() {
  256. // 基于准备好的dom,初始化echarts实例
  257. var myChart = echarts.init(document.getElementById('echarts2'));
  258. option = {
  259. tooltip: {
  260. trigger: 'axis',
  261. axisPointer: {
  262. lineStyle: {
  263. color: '#dddc6b'
  264. }
  265. }
  266. },
  267. grid: {
  268. left: '0',
  269. top: '30',
  270. right: '20',
  271. bottom: '-10',
  272. containLabel: true
  273. },legend: {
  274. data: ['字段1', '字段2'],
  275. right: 'center',
  276. top:0,
  277. textStyle: {
  278. color: "#fff"
  279. },
  280. itemWidth: 12,
  281. itemHeight: 10,
  282. // itemGap: 35
  283. },
  284. xAxis: [{
  285. type: 'category',
  286. boundaryGap: false,
  287. axisLabel: {
  288. textStyle: {
  289. color: "rgba(255,255,255,.6)",
  290. fontSize:14,
  291. },
  292. },
  293. axisLine: {
  294. lineStyle: {
  295. color: 'rgba(255,255,255,.1)'
  296. }
  297. },
  298. data: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00']
  299. }, {
  300. axisPointer: {show: false},
  301. axisLine: { show: false},
  302. position: 'bottom',
  303. offset: 20,
  304. }],
  305. yAxis: [{
  306. type: 'value',
  307. axisTick: {show: false},
  308. // splitNumber: 6,
  309. axisLine: {
  310. lineStyle: {
  311. color: 'rgba(255,255,255,.1)'
  312. }
  313. },
  314. axisLabel: {
  315. textStyle: {
  316. color: "rgba(255,255,255,.6)",
  317. fontSize:14,
  318. },
  319. },
  320. splitLine: {
  321. lineStyle: {
  322. color: 'rgba(255,255,255,.1)'
  323. }
  324. }
  325. }],
  326. series: [
  327. {
  328. name: '字段1',
  329. type: 'line',
  330. smooth: true,
  331. symbol: 'circle',
  332. symbolSize: 5,
  333. showSymbol: false,
  334. lineStyle: {
  335. normal: {
  336. color: 'rgba(228, 228, 126, 1)',
  337. width: 2
  338. }
  339. },
  340. areaStyle: {
  341. normal: {
  342. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  343. offset: 0,
  344. color: 'rgba(228, 228, 126, .8)'
  345. }, {
  346. offset: 0.8,
  347. color: 'rgba(228, 228, 126, 0.1)'
  348. }], false),
  349. shadowColor: 'rgba(0, 0, 0, 0.1)',
  350. }
  351. },
  352. itemStyle: {
  353. normal: {
  354. color: '#dddc6b',
  355. borderColor: 'rgba(221, 220, 107, .1)',
  356. borderWidth: 12
  357. }
  358. },
  359. data: [600, 200, 600, 200, 400, 200, 400, 300, 400, 300, 400, 300, 200, 400, 200 ]
  360. }, {
  361. name: '字段2',
  362. type: 'line',
  363. smooth: true,
  364. symbol: 'circle',
  365. symbolSize: 5,
  366. showSymbol: false,
  367. lineStyle: {
  368. normal: {
  369. color: 'rgba(255, 128, 128, 1)',
  370. width: 2
  371. }
  372. },
  373. areaStyle: {
  374. normal: {
  375. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  376. offset: 0,
  377. color: 'rgba(255, 128, 128,.8)'
  378. }, {
  379. offset: 0.8,
  380. color: 'rgba(255, 128, 128, .1)'
  381. }], false),
  382. shadowColor: 'rgba(0, 0, 0, 0.1)',
  383. }
  384. },
  385. itemStyle: {
  386. normal: {
  387. color: '#dddc6b',
  388. borderColor: 'rgba(221, 220, 107, .1)',
  389. borderWidth: 12
  390. }
  391. },
  392. data: [300, 100, 300, 400, 300, 400, 300, 600, 200, 400, 200, 400, 100, 300, 400]
  393. },
  394. ]
  395. };
  396. // 使用刚指定的配置项和数据显示图表。
  397. myChart.setOption(option);
  398. window.addEventListener("resize",function(){
  399. myChart.resize();
  400. });
  401. }
  402. function echarts_3() {
  403. // 基于准备好的dom,初始化echarts实例
  404. var myChart = echarts.init(document.getElementById('echarts3'));
  405. option = {
  406. tooltip: {
  407. trigger: 'axis',
  408. axisPointer: {
  409. lineStyle: {
  410. color: '#dddc6b'
  411. }
  412. }
  413. },
  414. grid: {
  415. left: '0',
  416. top: '30',
  417. right: '20',
  418. bottom: '-10',
  419. containLabel: true
  420. },
  421. xAxis: [{
  422. type: 'category',
  423. boundaryGap: false,
  424. axisLabel: {
  425. textStyle: {
  426. color: "rgba(255,255,255,.6)",
  427. fontSize:14,
  428. },
  429. },
  430. axisLine: {
  431. lineStyle: {
  432. color: 'rgba(255,255,255,.1)'
  433. }
  434. },
  435. data: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00']
  436. }, {
  437. axisPointer: {show: false},
  438. axisLine: { show: false},
  439. position: 'bottom',
  440. offset: 20,
  441. }],
  442. yAxis: [{
  443. type: 'value',
  444. axisTick: {show: false},
  445. axisLine: {
  446. lineStyle: {
  447. color: 'rgba(255,255,255,.1)'
  448. }
  449. },
  450. axisLabel: {
  451. textStyle: {
  452. color: "rgba(255,255,255,.6)",
  453. fontSize:14,
  454. },
  455. },
  456. splitLine: {
  457. lineStyle: {
  458. color: 'rgba(255,255,255,.1)',
  459. }
  460. }
  461. }],
  462. series: [
  463. {
  464. name: '标题名称',
  465. type: 'line',
  466. smooth: true,
  467. symbol: 'circle',
  468. symbolSize: 10,
  469. showSymbol: true,
  470. lineStyle: {
  471. normal: {
  472. color: 'rgba(228, 228, 126, 1)',
  473. width: 2
  474. }
  475. },
  476. areaStyle: {
  477. normal: {
  478. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  479. offset: 0,
  480. color: 'rgba(228, 228, 126, .8)'
  481. }, {
  482. offset: 0.8,
  483. color: 'rgba(228, 228, 126, 0.1)'
  484. }], false),
  485. shadowColor: 'rgba(0, 0, 0, 0.1)',
  486. }
  487. },
  488. itemStyle: {
  489. normal: {
  490. color: '#dddc6b',
  491. borderColor: 'rgba(221, 220, 107, .1)',
  492. borderWidth: 12
  493. }
  494. },
  495. data: [600, 200, 600, 200, 400, 200, 400, 300, 400, 300, 400, 300, 200, 400, 200 ]
  496. }
  497. ]
  498. };
  499. // 使用刚指定的配置项和数据显示图表。
  500. myChart.setOption(option);
  501. window.addEventListener("resize",function(){
  502. myChart.resize();
  503. });
  504. }
  505. function pe01() {
  506. // 基于准备好的dom,初始化echarts实例
  507. var myChart = echarts.init(document.getElementById('pe01'));
  508. var txt=80
  509. option = {
  510. title: {
  511. text: txt+'%',
  512. x: 'center',
  513. y: 'center',
  514. textStyle: {
  515. fontWeight: 'normal',
  516. color: '#fff',
  517. fontSize: '18'
  518. }
  519. },
  520. color:'#49bcf7',
  521. series: [{
  522. name: 'Line 1',
  523. type: 'pie',
  524. clockWise: true,
  525. radius: ['65%', '80%'],
  526. itemStyle: {
  527. normal: {
  528. label: {
  529. show: false
  530. },
  531. labelLine: {
  532. show: false
  533. }
  534. }
  535. },
  536. hoverAnimation: false,
  537. data: [{
  538. value: txt,
  539. name: '已使用',
  540. itemStyle: {
  541. normal: {
  542. color:'#eaff00',
  543. label: {
  544. show: false
  545. },
  546. labelLine: {
  547. show: false
  548. }
  549. }
  550. }
  551. }, {
  552. name: '未使用',
  553. value: 100-txt
  554. }]
  555. }]
  556. };
  557. // 使用刚指定的配置项和数据显示图表。
  558. myChart.setOption(option);
  559. window.addEventListener("resize",function(){
  560. myChart.resize();
  561. });
  562. }
  563. function pe02() {
  564. // 基于准备好的dom,初始化echarts实例
  565. var myChart = echarts.init(document.getElementById('pe02'));
  566. var txt=73
  567. option = {
  568. title: {
  569. text: txt+'%',
  570. x: 'center',
  571. y: 'center',
  572. textStyle: {
  573. fontWeight: 'normal',
  574. color: '#fff',
  575. fontSize: '18'
  576. }
  577. },
  578. color:'#49bcf7',
  579. series: [{
  580. name: 'Line 1',
  581. type: 'pie',
  582. clockWise: true,
  583. radius: ['65%', '80%'],
  584. itemStyle: {
  585. normal: {
  586. label: {
  587. show: false
  588. },
  589. labelLine: {
  590. show: false
  591. }
  592. }
  593. },
  594. hoverAnimation: false,
  595. data: [{
  596. value: txt,
  597. name: '已使用',
  598. itemStyle: {
  599. normal: {
  600. color:'#ea4d4d',
  601. label: {
  602. show: false
  603. },
  604. labelLine: {
  605. show: false
  606. }
  607. }
  608. }
  609. }, {
  610. name: '未使用',
  611. value: 100-txt
  612. }]
  613. }]
  614. };
  615. // 使用刚指定的配置项和数据显示图表。
  616. myChart.setOption(option);
  617. window.addEventListener("resize",function(){
  618. myChart.resize();
  619. });
  620. }
  621. function pe03() {
  622. // 基于准备好的dom,初始化echarts实例
  623. var myChart = echarts.init(document.getElementById('pe03'));
  624. var txt=30
  625. option = {
  626. title: {
  627. text: txt+'%',
  628. x: 'center',
  629. y: 'center',
  630. textStyle: {
  631. fontWeight: 'normal',
  632. color: '#fff',
  633. fontSize: '18'
  634. }
  635. },
  636. color:'#49bcf7',
  637. series: [{
  638. name: 'Line 1',
  639. type: 'pie',
  640. clockWise: true,
  641. radius: ['65%', '80%'],
  642. itemStyle: {
  643. normal: {
  644. label: {
  645. show: false
  646. },
  647. labelLine: {
  648. show: false
  649. }
  650. }
  651. },
  652. hoverAnimation: false,
  653. data: [{
  654. value: txt,
  655. name: '已使用',
  656. itemStyle: {
  657. normal: {
  658. color:'#395ee6',
  659. label: {
  660. show: false
  661. },
  662. labelLine: {
  663. show: false
  664. }
  665. }
  666. }
  667. }, {
  668. name: '未使用',
  669. value: 100-txt
  670. }
  671. ]
  672. }]
  673. };
  674. // 使用刚指定的配置项和数据显示图表。
  675. myChart.setOption(option);
  676. window.addEventListener("resize",function(){
  677. myChart.resize();
  678. });
  679. }
  680. function pe04() {
  681. // 基于准备好的dom,初始化echarts实例
  682. var myChart = echarts.init(document.getElementById('lastecharts'));
  683. option = {
  684. tooltip: {
  685. trigger: 'axis'
  686. },
  687. radar: [{
  688. indicator: [{
  689. text: '盈利能力',
  690. max: 100
  691. }, {
  692. text: '发展水平',
  693. max: 100
  694. }, {
  695. text: '融资能力',
  696. max: 100
  697. }, {
  698. text: '技术能力',
  699. max: 100
  700. }, {
  701. text: '企业规模',
  702. max: 100
  703. }],
  704. textStyle: {
  705. color: 'red'
  706. },
  707. center: ['50%', '50%'],
  708. radius: '70%',
  709. startAngle: 90,
  710. splitNumber: 4,
  711. shape: 'circle',
  712. name: {
  713. padding:-5,
  714. formatter: '{value}',
  715. textStyle: {
  716. fontSize:14,
  717. color: 'rgba(255,255,255,.6)'
  718. }
  719. },
  720. splitArea: {
  721. areaStyle: {
  722. color: 'rgba(255,255,255,.05)'
  723. }
  724. },
  725. axisLine: {
  726. lineStyle: {
  727. color: 'rgba(255,255,255,.05)'
  728. }
  729. },
  730. splitLine: {
  731. lineStyle: {
  732. color: 'rgba(255,255,255,.05)'
  733. }
  734. }
  735. }, ],
  736. series: [{
  737. name: '雷达图',
  738. type: 'radar',
  739. tooltip: {
  740. trigger: 'item'
  741. },
  742. data: [{
  743. name: '园区平均值',
  744. value: [90, 80, 20, 10, 30],
  745. lineStyle: {
  746. normal: {
  747. color:'#03b48e',
  748. width:2,
  749. }
  750. },
  751. areaStyle: {
  752. normal: {
  753. color: '#03b48e',
  754. opacity:.4
  755. }
  756. },
  757. symbolSize: 0,
  758. }, {
  759. name: '当前园区',
  760. value: [30, 20, 75, 80, 70],
  761. symbolSize: 0,
  762. lineStyle: {
  763. normal: {
  764. color:'#3893e5',
  765. width:2,
  766. }
  767. },
  768. areaStyle: {
  769. normal: {
  770. color: 'rgba(19, 173, 255, 0.5)'
  771. }
  772. }
  773. }]
  774. }, ]
  775. };
  776. // 使用刚指定的配置项和数据显示图表。
  777. myChart.setOption(option);
  778. window.addEventListener("resize",function(){
  779. myChart.resize();
  780. });
  781. }
  782. })