js.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757
  1.  $(window).load(function(){$(".loading").fadeOut()})
  2. $(function () {
  3. echarts_1();
  4. echarts_2();
  5. echarts_3();
  6. echarts_4();
  7. echarts_5();
  8. zb1();
  9. zb2();
  10. zb3();
  11. zb4();
  12. function echarts_1() {
  13. // 基于准备好的dom,初始化echarts实例
  14. var myChart = echarts.init(document.getElementById('echart1'));
  15. option = {
  16. tooltip : {
  17. trigger: 'item',
  18. formatter: "{b} : {c} ({d}%)"
  19. },
  20. legend: {
  21. right:10,
  22. top:30,
  23. height:140,
  24. itemWidth:10,
  25. itemHeight:10,
  26. itemGap:10,
  27. textStyle:{
  28. color: 'rgba(255,255,255,.6)',
  29. fontSize:12
  30. },
  31. orient:'vertical',
  32. data:['图例1','图例2','图例3','图例4']
  33. },
  34. calculable : true,
  35. series : [
  36. {
  37. name:' ',
  38. color: ['#62c98d', '#2f89cf', '#4cb9cf', '#53b666', '#62c98d', '#205acf', '#c9c862', '#c98b62', '#c962b9', '#7562c9','#c96262'],
  39. type:'pie',
  40. radius : [30, 70],
  41. center : ['35%', '50%'],
  42. roseType : 'radius',
  43. label: {
  44. normal: {
  45. show: true
  46. },
  47. emphasis: {
  48. show: true
  49. }
  50. },
  51. lableLine: {
  52. normal: {
  53. show: false
  54. },
  55. emphasis: {
  56. show: true
  57. }
  58. },
  59. data:[
  60. {value:10, name:'图例1'},
  61. {value:15, name:'图例2'},
  62. {value:25, name:'图例3'},
  63. {value:30, name:'图例4'}
  64. ]
  65. },
  66. ]
  67. };
  68. // 使用刚指定的配置项和数据显示图表。
  69. myChart.setOption(option);
  70. window.addEventListener("resize",function(){
  71. myChart.resize();
  72. });
  73. }
  74. function echarts_2() {
  75. // 基于准备好的dom,初始化echarts实例
  76. var myChart = echarts.init(document.getElementById('echart2'));
  77. option = {
  78. tooltip : {
  79. trigger: 'item',
  80. formatter: "{b} : {c} ({d}%)"
  81. },
  82. legend: {
  83. right:10,
  84. top:30,
  85. height:140,
  86. itemWidth:10,
  87. itemHeight:10,
  88. itemGap:10,
  89. textStyle:{
  90. color: 'rgba(255,255,255,.6)',
  91. fontSize:12
  92. },
  93. orient:'vertical',
  94. data:['图例1','图例2','图例3','图例4']
  95. },
  96. calculable : true,
  97. series : [
  98. {
  99. name:' ',
  100. color: ['#62c98d', '#205acf', '#c9c862', '#c98b62', '#c962b9', '#7562c9','#c96262'],
  101. type:'pie',
  102. radius : [30, 70],
  103. center : ['35%', '50%'],
  104. roseType : 'radius',
  105. label: {
  106. normal: {
  107. show: true
  108. },
  109. emphasis: {
  110. show: true
  111. }
  112. },
  113. lableLine: {
  114. normal: {
  115. show: true
  116. },
  117. emphasis: {
  118. show: true
  119. }
  120. },
  121. data:[
  122. {value:50, name:'图例1'},
  123. {value:45, name:'图例2'},
  124. {value:35, name:'图例3'},
  125. {value:30, name:'图例4'}
  126. ]
  127. },
  128. ]
  129. };
  130. // 使用刚指定的配置项和数据显示图表。
  131. myChart.setOption(option);
  132. window.addEventListener("resize",function(){
  133. myChart.resize();
  134. });
  135. }
  136. function echarts_3() {
  137. /* */
  138. // 基于准备好的dom,初始化echarts实例
  139. var myChart = echarts.init(document.getElementById('echart3'));
  140. option = {
  141. tooltip: {
  142. trigger: 'axis',
  143. axisPointer: {
  144. lineStyle: {
  145. color: '#dddc6b'
  146. }
  147. }
  148. },
  149. grid: {
  150. left: '10',
  151. top: '20',
  152. right: '30',
  153. bottom: '10',
  154. containLabel: true
  155. },
  156. xAxis: [{
  157. type: 'category',
  158. boundaryGap: false,
  159. axisLabel: {
  160. textStyle: {
  161. color: "rgba(255,255,255,.6)",
  162. fontSize:16,
  163. },
  164. },
  165. axisLine: {
  166. lineStyle: {
  167. color: 'rgba(255,255,255,.1)'
  168. }
  169. },
  170. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
  171. }, {
  172. axisPointer: {show: false},
  173. axisLine: { show: false},
  174. position: 'bottom',
  175. offset: 20,
  176. }],
  177. yAxis: [{
  178. type: 'value',
  179. axisTick: {show: false},
  180. axisLine: {
  181. lineStyle: {
  182. color: 'rgba(255,255,255,.1)'
  183. }
  184. },
  185. axisLabel: {
  186. textStyle: {
  187. color: "rgba(255,255,255,.6)",
  188. fontSize:16,
  189. },
  190. },
  191. splitLine: {
  192. lineStyle: {
  193. color: 'rgba(255,255,255,.1)'
  194. }
  195. }
  196. }],
  197. series: [
  198. {
  199. name: '结算率',
  200. type: 'line',
  201. smooth: true,
  202. symbol: 'circle',
  203. symbolSize: 5,
  204. showSymbol: false,
  205. lineStyle: {
  206. normal: {
  207. color: '#dddc6b',
  208. width: 4
  209. }
  210. },
  211. areaStyle: {
  212. normal: {
  213. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  214. offset: 0,
  215. color: 'rgba(221, 220, 107, 0.4)'
  216. }, {
  217. offset: 0.8,
  218. color: 'rgba(221, 220, 107, 0.1)'
  219. }], false),
  220. shadowColor: 'rgba(0, 0, 0, 0.1)',
  221. }
  222. },
  223. itemStyle: {
  224. normal: {
  225. color: '#dddc6b',
  226. borderColor: 'rgba(221, 220, 107, .1)',
  227. borderWidth: 12
  228. }
  229. },
  230. data: [3, 4, 3, 4, 3, 4, 3, 6, 2, 4, 2, 4]
  231. },
  232. ]
  233. };
  234. // 使用刚指定的配置项和数据显示图表。
  235. myChart.setOption(option);
  236. window.addEventListener("resize",function(){
  237. myChart.resize();
  238. });
  239. }
  240. function echarts_4() {
  241. // 基于准备好的dom,初始化echarts实例
  242. var myChart = echarts.init(document.getElementById('echart4'));
  243. option = {
  244. tooltip: {
  245. trigger: 'axis',
  246. axisPointer: {
  247. type: 'shadow'
  248. }
  249. },
  250. legend: {
  251. data: ['2017年', '2018年'],
  252. align: 'right',
  253. right: '40%',
  254. top:'0%',
  255. textStyle: {
  256. color: "#fff",
  257. fontSize: '16',
  258. },
  259. itemWidth: 16,
  260. itemHeight: 16,
  261. itemGap: 35
  262. },
  263. grid: {
  264. left: '0%',
  265. top:'40px',
  266. right: '0%',
  267. bottom: '2%',
  268. containLabel: true
  269. },
  270. xAxis: [{
  271. type: 'category',
  272. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
  273. axisLine: {
  274. show: true,
  275. lineStyle: {
  276. color: "rgba(255,255,255,.1)",
  277. width: 1,
  278. type: "solid"
  279. },
  280. },
  281. axisTick: {
  282. show: false,
  283. },
  284. axisLabel: {
  285. interval: 0,
  286. // rotate:50,
  287. show: true,
  288. splitNumber: 15,
  289. textStyle: {
  290. color: "rgba(255,255,255,.6)",
  291. fontSize: '16',
  292. },
  293. },
  294. }],
  295. yAxis: [{
  296. type: 'value',
  297. axisLabel: {
  298. //formatter: '{value} %'
  299. show:true,
  300. textStyle: {
  301. color: "rgba(255,255,255,.6)",
  302. fontSize: '16',
  303. },
  304. },
  305. axisTick: {
  306. show: false,
  307. },
  308. axisLine: {
  309. show: true,
  310. lineStyle: {
  311. color: "rgba(255,255,255,.1 )",
  312. width: 1,
  313. type: "solid"
  314. },
  315. },
  316. splitLine: {
  317. lineStyle: {
  318. color: "rgba(255,255,255,.1)",
  319. }
  320. }
  321. }],
  322. series: [{
  323. name: '2017年',
  324. type: 'bar',
  325. data: [2, 3, 3, 9, 15, 12, 6, 4, 6, 7, 4, 10],
  326. barWidth:'15', //柱子宽度
  327. // barGap: 1, //柱子之间间距
  328. itemStyle: {
  329. normal: {
  330. color:'#2f89cf',
  331. opacity: 1,
  332. barBorderRadius: 5,
  333. }
  334. }
  335. }, {
  336. name: '2018年',
  337. type: 'bar',
  338. data: [1, 4, 5, 11, 12, 9, 5, 6, 5, 6, 3, 9],
  339. barWidth:'15',
  340. // barGap: 1,
  341. itemStyle: {
  342. normal: {
  343. color:'#62c98d',
  344. opacity: 1,
  345. barBorderRadius: 5,
  346. }
  347. }
  348. },
  349. ]
  350. };
  351. /* */
  352. // 使用刚指定的配置项和数据显示图表。
  353. myChart.setOption(option);
  354. window.addEventListener("resize",function(){
  355. myChart.resize();
  356. });
  357. }
  358. function echarts_5() {
  359. // 基于准备好的dom,初始化echarts实例
  360. var myChart = echarts.init(document.getElementById('echart5'));
  361. option = {
  362. // backgroundColor: '#00265f',
  363. tooltip: {
  364. trigger: 'axis',
  365. axisPointer: {
  366. type: 'shadow'
  367. }
  368. },
  369. legend: {
  370. data: ['2017年', '2018年'],
  371. align: 'right',
  372. right: '40%',
  373. top:'0%',
  374. textStyle: {
  375. color: "#fff",
  376. fontSize: '16',
  377. },
  378. itemGap: 35
  379. },
  380. grid: {
  381. left: '0%',
  382. top:'40px',
  383. right: '0%',
  384. bottom: '2%',
  385. containLabel: true
  386. },
  387. xAxis: [{
  388. type: 'category',
  389. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
  390. axisLine: {
  391. show: true,
  392. lineStyle: {
  393. color: "rgba(255,255,255,.1)",
  394. width: 1,
  395. type: "solid"
  396. },
  397. },
  398. axisTick: {
  399. show: false,
  400. },
  401. axisLabel: {
  402. interval: 0,
  403. // rotate:50,
  404. show: true,
  405. splitNumber: 15,
  406. textStyle: {
  407. color: "rgba(255,255,255,.6)",
  408. fontSize: '16',
  409. },
  410. },
  411. }],
  412. yAxis: [{
  413. type: 'value',
  414. axisLabel: {
  415. //formatter: '{value} %'
  416. show:true,
  417. textStyle: {
  418. color: "rgba(255,255,255,.6)",
  419. fontSize: '16',
  420. },
  421. },
  422. axisTick: {
  423. show: false,
  424. },
  425. axisLine: {
  426. show: true,
  427. lineStyle: {
  428. color: "rgba(255,255,255,.1 )",
  429. width: 1,
  430. type: "solid"
  431. },
  432. },
  433. splitLine: {
  434. lineStyle: {
  435. color: "rgba(255,255,255,.1)",
  436. }
  437. }
  438. }],
  439. series: [{
  440. name: '2017年',
  441. type: 'line',
  442. data: [2, 6, 3, 8, 5, 8, 10, 13, 8, 5, 6, 9],
  443. itemStyle: {
  444. normal: {
  445. color:'#2f89cf',
  446. opacity: 1,
  447. barBorderRadius: 5,
  448. }
  449. }
  450. }, {
  451. name: '2018年',
  452. type: 'line',
  453. data: [5, 2, 6, 4, 5, 12, 5, 17, 9, 2, 6, 3],
  454. barWidth:'15',
  455. // barGap: 1,
  456. itemStyle: {
  457. normal: {
  458. color:'#62c98d',
  459. opacity: 1,
  460. barBorderRadius: 5,
  461. }
  462. }
  463. },
  464. ]
  465. };
  466. // 使用刚指定的配置项和数据显示图表。
  467. myChart.setOption(option);
  468. window.addEventListener("resize",function(){
  469. myChart.resize();
  470. });
  471. }
  472. function zb1() {
  473. // 基于准备好的dom,初始化echarts实例
  474. var myChart = echarts.init(document.getElementById('zb1'));
  475. var v1=60//结算数
  476. var v2=40//未结算数
  477. var v3=v1+v2//总订单数
  478. option = {
  479. series: [{
  480. type: 'pie',
  481. radius: ['60%', '70%'],
  482. color:'#49bcf7',
  483. label: {
  484. normal: {
  485. position: 'center'
  486. }
  487. },
  488. data: [{
  489. value: v1,
  490. name: '数量结算率',
  491. label: {
  492. normal: {
  493. formatter:Math.round( v1/v3*100)+ '%',
  494. textStyle: {
  495. fontSize: 30,
  496. color:'#fff',
  497. }
  498. }
  499. }
  500. },
  501. {
  502. value: v2,
  503. label: {
  504. normal: {
  505. formatter : function (params){
  506. return '数量结算率'
  507. },
  508. textStyle: {
  509. color: '#aaa',
  510. fontSize: 16
  511. }
  512. }
  513. },
  514. itemStyle: {
  515. normal: {
  516. color: 'rgba(255,255,255,.2)'
  517. },
  518. emphasis: {
  519. color: '#fff'
  520. }
  521. },
  522. }]
  523. }]
  524. };
  525. myChart.setOption(option);
  526. window.addEventListener("resize",function(){
  527. myChart.resize();
  528. });
  529. }
  530. function zb2() {
  531. // 基于准备好的dom,初始化echarts实例
  532. var myChart = echarts.init(document.getElementById('zb2'));
  533. var v1=80//结算数
  534. var v2=20//未结算数
  535. var v3=v1+v2//总订单数
  536. option = {
  537. //animation: false,
  538. series: [{
  539. type: 'pie',
  540. radius: ['60%', '70%'],
  541. color:'#49bcf7',
  542. label: {
  543. normal: {
  544. position: 'center'
  545. }
  546. },
  547. data: [{
  548. value: v1,
  549. name: '数量结算率',
  550. label: {
  551. normal: {
  552. formatter:Math.round( v1/v3*100)+ '%',
  553. textStyle: {
  554. fontSize: 24,
  555. color:'#fff',
  556. }
  557. }
  558. }
  559. }, {
  560. value: v2,
  561. label: {
  562. normal: {
  563. formatter : function (params){
  564. return '数量结算率'
  565. },
  566. textStyle: {
  567. color: '#aaa',
  568. fontSize: 16
  569. }
  570. }
  571. },
  572. itemStyle: {
  573. normal: {
  574. color: 'rgba(255,255,255,.2)'
  575. },
  576. emphasis: {
  577. color: '#fff'
  578. }
  579. },
  580. }]
  581. }]
  582. };
  583. myChart.setOption(option);
  584. window.addEventListener("resize",function(){
  585. myChart.resize();
  586. });
  587. }
  588. function zb3() {
  589. // 基于准备好的dom,初始化echarts实例
  590. var myChart = echarts.init(document.getElementById('zb3'));
  591. var v1=30//结算金额
  592. var v2=70//未结算
  593. var v3=v1+v2
  594. option = {
  595. series: [{
  596. type: 'pie',
  597. radius: ['60%', '70%'],
  598. color:'#62c98d',
  599. label: {
  600. normal: {
  601. position: 'center'
  602. }
  603. },
  604. data: [{
  605. value: v1,
  606. name: '金额结算率',
  607. label: {
  608. normal: {
  609. formatter:Math.round( v1/v3*100)+ '%',
  610. textStyle: {
  611. fontSize: 24,
  612. color:'#fff',
  613. }
  614. }
  615. }
  616. }, {
  617. value: v2,
  618. label: {
  619. normal: {
  620. formatter : function (params){
  621. return '金额结算率'
  622. },
  623. textStyle: {
  624. color: '#aaa',
  625. fontSize: 16
  626. }
  627. }
  628. },
  629. itemStyle: {
  630. normal: {
  631. color: 'rgba(255,255,255,.2)'
  632. },
  633. emphasis: {
  634. color: '#fff'
  635. }
  636. },
  637. }]
  638. }]
  639. };
  640. myChart.setOption(option);
  641. window.addEventListener("resize",function(){
  642. myChart.resize();
  643. });
  644. }
  645. function zb4() {
  646. // 基于准备好的dom,初始化echarts实例
  647. var myChart = echarts.init(document.getElementById('zb4'));
  648. var v1=90//结算金额
  649. var v2=10//未结算
  650. var v3=v1+v2
  651. option = {
  652. series: [{
  653. type: 'pie',
  654. radius: ['60%', '70%'],
  655. color:'#29d08a',
  656. label: {
  657. normal: {
  658. position: 'center'
  659. }
  660. },
  661. data: [{
  662. value: v1,
  663. name: '金额结算率',
  664. label: {
  665. normal: {
  666. formatter:Math.round( v1/v3*100)+ '%',
  667. textStyle: {
  668. fontSize: 24,
  669. color:'#fff',
  670. }
  671. }
  672. }
  673. }, {
  674. value: v2,
  675. label: {
  676. normal: {
  677. formatter : function (params){
  678. return '金额结算率'
  679. },
  680. textStyle: {
  681. color: '#aaa',
  682. fontSize: 16
  683. }
  684. }
  685. },
  686. itemStyle: {
  687. normal: {
  688. color: 'rgba(255,255,255,.2)'
  689. },
  690. emphasis: {
  691. color: '#fff'
  692. }
  693. },
  694. }]
  695. }]
  696. };
  697. myChart.setOption(option);
  698. window.addEventListener("resize",function(){
  699. myChart.resize();
  700. });
  701. }
  702. })