js.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035
  1.  $(window).load(function(){
  2. $(".loading").fadeOut()
  3. })
  4. /****/
  5. $(document).ready(function(){
  6. var whei=$(window).width()
  7. $("html").css({fontSize:whei/20})
  8. $(window).resize(function(){
  9. var whei=$(window).width()
  10. $("html").css({fontSize:whei/20})
  11. });
  12. });
  13. $(window).load(function(){$(".loading").fadeOut()})
  14. $(function () {
  15. echarts_1()
  16. echarts_2()
  17. echarts_3()
  18. echarts_4()
  19. echarts_5()
  20. echarts_6()
  21. pe01()
  22. pe02()
  23. pe03()
  24. function echarts_1() {
  25. var myChart = echarts.init(document.getElementById('echarts1'));
  26. option = {
  27. tooltip: {
  28. trigger: 'axis',
  29. axisPointer: {type: 'shadow'},
  30. },"grid": {
  31. "top": "20%",
  32. "right":"50",
  33. "bottom":"20",
  34. "left":"30",
  35. },
  36. legend: {
  37. data: ['字段1', '字段2', '字段3','字段4','字段5','字段6'],
  38. right: 'center', width:'100%',
  39. textStyle: {
  40. color: "#fff"
  41. },
  42. itemWidth: 12,
  43. itemHeight: 10,
  44. },
  45. "xAxis": [
  46. {
  47. "type": "category",
  48. data: ['2016', '2017', '2018', '2019'],
  49. axisLine: { lineStyle: {color: "rgba(255,255,255,.1)"}},
  50. axisLabel: { textStyle: {color: "rgba(255,255,255,.7)", fontSize: '14', },
  51. },
  52. },
  53. ],
  54. "yAxis": [
  55. {
  56. "type": "value",
  57. "name": "单位万",
  58. axisTick: {show: false},
  59. splitLine: {
  60. show: false,
  61. },
  62. "axisLabel": {
  63. "show": true,
  64. fontSize:14,
  65. color: "rgba(255,255,255,.6)"
  66. },
  67. axisLine: {
  68. min:0,
  69. max:10,
  70. lineStyle: {color: 'rgba(255,255,255,.1)'}
  71. },//左线色
  72. },
  73. {
  74. "type": "value",
  75. "name": "增速",
  76. "show": true,
  77. "axisLabel": {
  78. "show": true,
  79. fontSize:14,
  80. formatter: "{value} %",
  81. color: "rgba(255,255,255,.6)"
  82. },
  83. axisTick: {show: false},
  84. axisLine: {lineStyle: {color: 'rgba(255,255,255,.1)'}},//右线色
  85. splitLine: {show:true,lineStyle: {color:'rgba(255,255,255,.1)'}},//x轴线
  86. },
  87. ],
  88. "series": [
  89. {
  90. "name": "字段1",
  91. "type": "bar",
  92. "data": [36.6,38.80, 40.84, 41.60],
  93. "barWidth": "15%",
  94. "itemStyle": {
  95. "normal": {
  96. barBorderRadius: 15,
  97. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  98. offset: 0,
  99. color: '#8bd46e'
  100. }, {
  101. offset: 1,
  102. color: '#09bcb7'
  103. }]),
  104. }
  105. },
  106. "barGap": "0.2"
  107. },
  108. {
  109. "name": "字段2",
  110. "type": "bar",
  111. "data":[14.8,14.1, 15, 16.30],
  112. "barWidth": "15%",
  113. "itemStyle": {
  114. "normal": {
  115. barBorderRadius: 15,
  116. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  117. offset: 0,
  118. color: '#248ff7'
  119. }, {
  120. offset: 1,
  121. color: '#6851f1'
  122. }]),
  123. }
  124. },
  125. "barGap": "0.2"
  126. },
  127. {
  128. "name": "字段3",
  129. "type": "bar",
  130. "data":[9.2,9.1, 9.85, 8.9],
  131. "barWidth": "15%",
  132. "itemStyle": {
  133. "normal": {
  134. barBorderRadius: 15,
  135. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  136. offset: 0,
  137. color: '#fccb05'
  138. }, {
  139. offset: 1,
  140. color: '#f5804d'
  141. }]),
  142. }
  143. },
  144. "barGap": "0.2"
  145. },
  146. {
  147. "name": "字段4",
  148. "type": "line",
  149. smooth: true,
  150. "yAxisIndex": 1,
  151. "data": [0,6.01, 5.26, 1.48],
  152. lineStyle: {
  153. normal: {
  154. width: 2
  155. },
  156. },
  157. "itemStyle": {
  158. "normal": {
  159. "color": "#86d370",
  160. }
  161. },
  162. }
  163. ,
  164. {
  165. "name": "字段5",
  166. "type": "line",
  167. "yAxisIndex": 1,
  168. "data": [0, -4.73, 6.38,8.67],
  169. lineStyle: {
  170. normal: {
  171. width: 2
  172. },
  173. },
  174. "itemStyle": {
  175. "normal": {
  176. "color": "#3496f8",
  177. }
  178. },
  179. "smooth": true
  180. } ,
  181. {
  182. "name": "字段6",
  183. "type": "line",
  184. "yAxisIndex": 1,
  185. "data":[0,-1.09, 8.24, -9.64],
  186. lineStyle: {
  187. normal: {
  188. width: 2
  189. },
  190. },
  191. "itemStyle": {
  192. "normal": {
  193. "color": "#fbc30d",
  194. }
  195. },
  196. "smooth": true
  197. }
  198. ]
  199. };
  200. myChart.setOption(option);
  201. window.addEventListener("resize",function(){
  202. myChart.resize();
  203. });
  204. }
  205. function echarts_2() {
  206. // 基于准备好的dom,初始化echarts实例
  207. var myChart = echarts.init(document.getElementById('echarts2'));
  208. option = {
  209. tooltip: {
  210. trigger: 'axis',
  211. axisPointer: {type: 'shadow'},
  212. // formatter:'{c}' ,
  213. },
  214. grid: {
  215. left: '0',
  216. top: '30',
  217. right: '10',
  218. bottom: '-20',
  219. containLabel: true
  220. },
  221. legend: {
  222. data: ['字段1', '字段2'],
  223. right: 'center',
  224. top:0,
  225. textStyle: {
  226. color: "#fff"
  227. },
  228. itemWidth: 12,
  229. itemHeight: 10,
  230. // itemGap: 35
  231. },
  232. xAxis: [{
  233. type: 'category',
  234. boundaryGap: false,
  235. axisLabel: {
  236. rotate: -90,
  237. textStyle: {
  238. color: "rgba(255,255,255,.6)",
  239. fontSize:14,
  240. },
  241. },
  242. axisLine: {
  243. lineStyle: {
  244. color: 'rgba(255,255,255,.1)'
  245. }
  246. },
  247. data: ['17年3月', '17年6月', '17年9月', '17年12月', '18年3月', '18年6月', '18年9月', '18年12月', '19年3月', '19年6月', '19年9月', '19年12月']
  248. }, {
  249. axisPointer: {show: false},
  250. axisLine: { show: false},
  251. position: 'bottom',
  252. offset: 20,
  253. }],
  254. yAxis: [{
  255. type: 'value',
  256. axisTick: {show: false},
  257. // splitNumber: 6,
  258. axisLine: {
  259. lineStyle: {
  260. color: 'rgba(255,255,255,.1)'
  261. }
  262. },
  263. axisLabel: {
  264. formatter: "{value} %",
  265. textStyle: {
  266. color: "rgba(255,255,255,.6)",
  267. fontSize:14,
  268. },
  269. },
  270. splitLine: {
  271. lineStyle: {
  272. color: 'rgba(255,255,255,.1)'
  273. }
  274. }
  275. }],
  276. series: [
  277. {
  278. name: '字段1',
  279. type: 'line',
  280. smooth: true,
  281. symbol: 'circle',
  282. symbolSize: 5,
  283. showSymbol: false,
  284. lineStyle: {
  285. normal: {
  286. color: 'rgba(228, 228, 126, 1)',
  287. width: 2
  288. }
  289. },
  290. areaStyle: {
  291. normal: {
  292. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  293. offset: 0,
  294. color: 'rgba(228, 228, 126, .2)'
  295. }, {
  296. offset: 1,
  297. color: 'rgba(228, 228, 126, 0)'
  298. }], false),
  299. shadowColor: 'rgba(0, 0, 0, 0.1)',
  300. }
  301. },
  302. itemStyle: {
  303. normal: {
  304. color: 'rgba(228, 228, 126, 1)',
  305. borderColor: 'rgba(228, 228, 126, .1)',
  306. borderWidth: 12
  307. }
  308. },
  309. data: [12.50, 14.4, 16.1, 14.9, 20.1, 17.2, 17.0, 13.42, 20.12, 18.94, 17.27, 16.10 ]
  310. }, {
  311. name: '字段2',
  312. type: 'line',
  313. smooth: true,
  314. symbol: 'circle',
  315. symbolSize: 5,
  316. showSymbol: false,
  317. lineStyle: {
  318. normal: {
  319. color: 'rgba(255, 128, 128, 1)',
  320. width: 2
  321. }
  322. },
  323. areaStyle: {
  324. normal: {
  325. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  326. offset: 0,
  327. color: 'rgba(255, 128, 128,.2)'
  328. }, {
  329. offset:1,
  330. color: 'rgba(255, 128, 128, 0)'
  331. }], false),
  332. shadowColor: 'rgba(0, 0, 0, 0.1)',
  333. }
  334. },
  335. itemStyle: {
  336. normal: {
  337. color: 'rgba(255, 128, 128, 1)',
  338. borderColor: 'rgba(255, 128, 128, .1)',
  339. borderWidth: 12
  340. }
  341. },
  342. data: [-6.4, 0.1, 6.6, 11.2, 42.1, 26.0, 20.2, 18.31, 21.59, 24.42, 34.03, 32.9]
  343. },
  344. ]
  345. };
  346. // 使用刚指定的配置项和数据显示图表。
  347. myChart.setOption(option);
  348. window.addEventListener("resize",function(){
  349. myChart.resize();
  350. });
  351. }
  352. function echarts_3() {
  353. // 基于准备好的dom,初始化echarts实例
  354. var myChart = echarts.init(document.getElementById('echarts3'));
  355. option = {
  356. tooltip: {
  357. trigger: 'axis',
  358. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  359. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  360. }
  361. },
  362. legend: {
  363. data: ['字段1', '字段2', '字段3'],
  364. right: 'center',
  365. top:0,
  366. textStyle: {
  367. color: "#fff"
  368. },
  369. itemWidth: 12,
  370. itemHeight: 10,
  371. // itemGap: 35
  372. },
  373. grid: {
  374. left: '0',
  375. right: '20',
  376. bottom: '0',
  377. top:'15%',
  378. containLabel: true
  379. },
  380. xAxis: {
  381. type: 'category',
  382. data: ['字段1','字段2','字段3','字段3','字段4','字段5','字段6','字段7','字段8','字段9'],
  383. axisLine: {
  384. lineStyle: {
  385. color: 'white'
  386. }
  387. },
  388. axisLabel: {
  389. //rotate:-90,
  390. formatter:function(value){return value.split("").join("\n");},
  391. textStyle: {
  392. color: "rgba(255,255,255,.6)",
  393. fontSize:14,
  394. }
  395. },
  396. axisLine: {
  397. lineStyle: {
  398. color: 'rgba(255,255,255,0.3)'
  399. }
  400. },
  401. },
  402. yAxis: {
  403. type: 'value',
  404. splitNumber: 4,
  405. axisTick: {show: false},
  406. splitLine: {
  407. show: true,
  408. lineStyle: {
  409. color: 'rgba(255,255,255,0.1)'
  410. }
  411. },
  412. axisLabel: {textStyle: {
  413. color: "rgba(255,255,255,.6)",
  414. fontSize:14,
  415. }},
  416. axisLine: {show:false},
  417. },
  418. series: [{
  419. name: '字段1',
  420. type: 'bar',
  421. stack: 'a',
  422. barWidth: '30',barGap: 0,
  423. itemStyle: {
  424. normal: {
  425. color: '#8bd46e', }
  426. },
  427. data: [331, 497, 440, 81, 163, 366, 57, 188, 172, 2295]
  428. },
  429. {
  430. name: '字段2',
  431. type: 'bar',
  432. stack: 'a',
  433. barWidth: '30',barGap: 0,
  434. itemStyle: {
  435. normal: {
  436. color: '#f5804d',
  437. barBorderRadius:0, }
  438. },
  439. data: [48, -97, 56, -59, 90, 98, 64, 61, -8, 253]
  440. },
  441. {
  442. name: '字段3',
  443. type: 'bar',
  444. stack: 'a',
  445. barWidth: '30',barGap: 0,
  446. itemStyle: {
  447. normal: {
  448. color: '#248ff7',
  449. barBorderRadius:0, }
  450. },
  451. data: [ -13, -21, -112, 5, 0, -5, 72, -3, 8, -69]
  452. }
  453. ]
  454. };
  455. // 使用刚指定的配置项和数据显示图表。
  456. myChart.setOption(option);
  457. window.addEventListener("resize",function(){
  458. myChart.resize();
  459. });
  460. }
  461. function echarts_5() {
  462. // 基于准备好的dom,初始化echarts实例
  463. var myChart = echarts.init(document.getElementById('echarts5'));
  464. option = {
  465. tooltip: {
  466. trigger: 'axis',
  467. axisPointer: {type: 'shadow'},
  468. },"grid": {
  469. "top": "15%",
  470. "right":"10%",
  471. "bottom":"20",
  472. "left":"10%",
  473. },
  474. legend: {
  475. data: ['字段1', '字段2'],
  476. right: 'center',
  477. top:0,
  478. textStyle: {
  479. color: "#fff"
  480. },
  481. itemWidth: 12,
  482. itemHeight: 10,
  483. },
  484. "xAxis": [
  485. {
  486. "type": "category",
  487. data: ['2016', '2017', '2018', '2019'],
  488. axisLine: { lineStyle: {color: "rgba(255,255,255,.1)"}},
  489. axisLabel: { textStyle: {color: "rgba(255,255,255,.7)", fontSize: '14', },
  490. },
  491. },
  492. ],
  493. "yAxis": [
  494. {
  495. "type": "value",
  496. "name": "单位1",
  497. splitLine: {show: false},
  498. axisTick: {show: false},
  499. "axisLabel": {
  500. "show": true,
  501. color: "rgba(255,255,255,.6)"
  502. },
  503. axisLine: {lineStyle: {color: 'rgba(255,255,255,.1)'}},//左线色
  504. },
  505. {
  506. "type": "value",
  507. "name": "单位2",
  508. "show": true,
  509. axisTick: {show: false},
  510. "axisLabel": {
  511. "show": true,
  512. formatter: "{value} %",
  513. color: "rgba(255,255,255,.6)"
  514. },
  515. axisLine: {lineStyle: {color: 'rgba(255,255,255,.1)'}},//右线色
  516. splitLine: {show:true,lineStyle: {color:'rgba(255,255,255,.1)'}},//x轴线
  517. },
  518. ],
  519. "series": [
  520. {
  521. "name": "字段1",
  522. "type": "bar",
  523. "data": [
  524. 18453.35 ,20572.22 ,24274.22 ,30500.00
  525. ],
  526. "barWidth": "20%",
  527. "itemStyle": {
  528. "normal": {
  529. barBorderRadius: 15,
  530. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  531. offset: 0,
  532. color: '#fccb05'
  533. }, {
  534. offset: 1,
  535. color: '#f5804d'
  536. }]),
  537. }
  538. },
  539. "barGap": "0"
  540. },
  541. {
  542. "name": "字段2",
  543. "type": "line",
  544. "yAxisIndex": 1,
  545. "data": [0,11.48,18.00,25.65],
  546. lineStyle: {
  547. normal: {
  548. width: 2
  549. },
  550. },
  551. "itemStyle": {
  552. "normal": {
  553. "color": "#ff3300",
  554. }
  555. },
  556. "smooth": true
  557. }
  558. ]
  559. };
  560. // 使用刚指定的配置项和数据显示图表。
  561. myChart.setOption(option);
  562. window.addEventListener("resize",function(){
  563. myChart.resize();
  564. });
  565. }
  566. function echarts_4() {
  567. // 基于准备好的dom,初始化echarts实例
  568. var myChart = echarts.init(document.getElementById('echarts4'));
  569. var myColor=['#eb2100','#eb3600','#d0570e','#d0a00e','#34da62','#00e9db','#00c0e9','#0096f3'];
  570. option = {
  571. grid: {
  572. left: '2%',
  573. top:'1%',
  574. right: '5%',
  575. bottom: '0%',
  576. containLabel: true
  577. },
  578. xAxis: [{
  579. show: false,
  580. }],
  581. yAxis: [{
  582. axisTick:'none',
  583. axisLine:'none',
  584. offset:'7',
  585. axisLabel: {
  586. textStyle: {
  587. color: 'rgba(255,255,255,.6)',
  588. fontSize:'14',
  589. }
  590. },
  591. data: ['字段1','字段2','字段3','字段4','字段5','字段6','字段7','字段8','字段9']
  592. }, {
  593. axisTick:'none',
  594. axisLine:'none',
  595. axisLabel: {
  596. textStyle: {
  597. color: 'rgba(255,255,255,.6)',
  598. fontSize:'14',
  599. }
  600. },
  601. data: [1514, 1619, 1623,1968,2158,2456 ,3506,4664,8390]
  602. },{
  603. name:'单位:件',
  604. nameGap:'50',
  605. nameTextStyle:{
  606. color: 'rgba(255,255,255,.6)',
  607. fontSize:'16',
  608. },
  609. axisLine:{
  610. lineStyle:{
  611. color:'rgba(0,0,0,0)'
  612. }
  613. },
  614. data: [],
  615. }],
  616. series: [{
  617. name: '条',
  618. type: 'bar',
  619. yAxisIndex: 0,
  620. data: [25,30,34,40,43,48,52,56,70],
  621. label:{
  622. normal:{
  623. show:true,
  624. position:'right',
  625. formatter:function(param){
  626. return param.value + '%';
  627. },
  628. textStyle:{
  629. color: 'rgba(255,255,255,.8)',
  630. fontSize:'12',
  631. }
  632. }
  633. },
  634. barWidth: 15,
  635. itemStyle: {
  636. normal: {
  637. color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
  638. offset: 0,
  639. color: '#03c893'
  640. },
  641. {
  642. offset: 1,
  643. color: '#0091ff'
  644. }
  645. ]),
  646. barBorderRadius: 15,
  647. }
  648. },
  649. z: 2
  650. }, {
  651. name: '白框',
  652. type: 'bar',
  653. yAxisIndex: 1,
  654. barGap: '-100%',
  655. data: [99.5,99.5,99.5,99.5,99.5,99.5,99.5,99.5,99.5,99.5],
  656. barWidth: 15,
  657. itemStyle: {
  658. normal: {
  659. color:'rgba(0,0,0,.2)',
  660. barBorderRadius:15,
  661. }
  662. },
  663. z: 1
  664. }]
  665. };
  666. // 使用刚指定的配置项和数据显示图表。
  667. myChart.setOption(option);
  668. window.addEventListener("resize",function(){
  669. myChart.resize();
  670. });
  671. }
  672. function echarts_6() {
  673. // 基于准备好的dom,初始化echarts实例
  674. var myChart = echarts.init(document.getElementById('echarts6'));
  675. option = {
  676. title:{
  677. text:'5132',
  678. subtext:'总体',
  679. x:'center',
  680. y:'40%',
  681. textStyle:{
  682. color:'#fff',
  683. fontSize:22,
  684. lineHeight:10,
  685. },
  686. subtextStyle: {
  687. color:'#90979c',
  688. fontSize:16,
  689. lineHeight:10,
  690. },
  691. },
  692. tooltip: {
  693. trigger: 'item',
  694. formatter: "{b} : {c} ({d}%)"
  695. },
  696. visualMap: {
  697. show: false,
  698. min: 500,
  699. max: 600,
  700. inRange: {
  701. //colorLightness: [0, 1]
  702. }
  703. },
  704. series: [{
  705. name: '访问来源',
  706. type: 'pie',
  707. radius: ['50%', '70%'],
  708. center: ['50%', '50%'],
  709. color: ['rgb(131,249,103)', '#FBFE27', '#FE5050', '#1DB7E5'], //'#FBFE27','rgb(11,228,96)','#FE5050'
  710. data: [{
  711. "value": 1924,
  712. "name": "字段名称1"
  713. }, {
  714. "value": 1055,
  715. "name": "字段名称2"
  716. }, {
  717. "value": 1532,
  718. "name": "字段名称3"}
  719. ].sort(function(a, b) {
  720. return a.value - b.value
  721. }),
  722. roseType: 'radius',
  723. label: {
  724. normal: {
  725. formatter: ['{c|{c}万}', '{b|{b}}'].join('\n'),
  726. rich: {
  727. c: {
  728. color: 'rgb(241,246,104)',
  729. fontSize: 20,
  730. fontWeight:'bold',
  731. lineHeight: 5
  732. },
  733. b: {
  734. color: 'rgb(98,137,169)',
  735. fontSize: 14,
  736. height: 44
  737. },
  738. },
  739. }
  740. },
  741. labelLine: {
  742. normal: {
  743. lineStyle: {
  744. color: 'rgb(98,137,169)',
  745. },
  746. smooth: 0.2,
  747. length: 10,
  748. length2: 20,
  749. }
  750. }
  751. }]
  752. };
  753. // 使用刚指定的配置项和数据显示图表。
  754. myChart.setOption(option);
  755. window.addEventListener("resize",function(){
  756. myChart.resize();
  757. });
  758. }
  759. function pe01() {
  760. // 基于准备好的dom,初始化echarts实例
  761. var myChart = echarts.init(document.getElementById('pe01'));
  762. var txt=81
  763. option = {
  764. title: {
  765. text: txt+'%',
  766. x: 'center',
  767. y: 'center',
  768. textStyle: {
  769. fontWeight: 'normal',
  770. color: '#fff',
  771. fontSize: '18'
  772. }
  773. },
  774. color:'rgba(255,255,255,.3)',
  775. series: [{
  776. name: 'Line 1',
  777. type: 'pie',
  778. clockWise: true,
  779. radius: ['65%', '80%'],
  780. itemStyle: {
  781. normal: {
  782. label: {
  783. show: false
  784. },
  785. labelLine: {
  786. show: false
  787. }
  788. }
  789. },
  790. hoverAnimation: false,
  791. data: [{
  792. value: txt,
  793. name: '已使用',
  794. itemStyle: {
  795. normal: {
  796. color:'#eaff00',
  797. label: {
  798. show: false
  799. },
  800. labelLine: {
  801. show: false
  802. }
  803. }
  804. }
  805. }, {
  806. name: '未使用',
  807. value: 100-txt
  808. }]
  809. }]
  810. };
  811. // 使用刚指定的配置项和数据显示图表。
  812. myChart.setOption(option);
  813. window.addEventListener("resize",function(){
  814. myChart.resize();
  815. });
  816. }
  817. function pe02() {
  818. // 基于准备好的dom,初始化echarts实例
  819. var myChart = echarts.init(document.getElementById('pe02'));
  820. var txt=17
  821. option = {
  822. title: {
  823. text: txt+'%',
  824. x: 'center',
  825. y: 'center',
  826. textStyle: {
  827. fontWeight: 'normal',
  828. color: '#fff',
  829. fontSize: '18'
  830. }
  831. },
  832. color:'rgba(255,255,255,.3)',
  833. series: [{
  834. name: 'Line 1',
  835. type: 'pie',
  836. clockWise: true,
  837. radius: ['65%', '80%'],
  838. itemStyle: {
  839. normal: {
  840. label: {
  841. show: false
  842. },
  843. labelLine: {
  844. show: false
  845. }
  846. }
  847. },
  848. hoverAnimation: false,
  849. data: [{
  850. value: txt,
  851. name: '已使用',
  852. itemStyle: {
  853. normal: {
  854. color:'#ea4d4d',
  855. label: {
  856. show: false
  857. },
  858. labelLine: {
  859. show: false
  860. }
  861. }
  862. }
  863. }, {
  864. name: '未使用',
  865. value: 100-txt
  866. }]
  867. }]
  868. };
  869. // 使用刚指定的配置项和数据显示图表。
  870. myChart.setOption(option);
  871. window.addEventListener("resize",function(){
  872. myChart.resize();
  873. });
  874. }
  875. function pe03() {
  876. // 基于准备好的dom,初始化echarts实例
  877. var myChart = echarts.init(document.getElementById('pe03'));
  878. var txt=2
  879. option = {
  880. title: {
  881. text: txt+'%',
  882. x: 'center',
  883. y: 'center',
  884. textStyle: {
  885. fontWeight: 'normal',
  886. color: '#fff',
  887. fontSize: '18'
  888. }
  889. },
  890. color:'rgba(255,255,255,.3)',
  891. series: [{
  892. name: 'Line 1',
  893. type: 'pie',
  894. clockWise: true,
  895. radius: ['65%', '80%'],
  896. itemStyle: {
  897. normal: {
  898. label: {
  899. show: false
  900. },
  901. labelLine: {
  902. show: false
  903. }
  904. }
  905. },
  906. hoverAnimation: false,
  907. data: [{
  908. value: txt,
  909. name: '已使用',
  910. itemStyle: {
  911. normal: {
  912. color:'#395ee6',
  913. label: {
  914. show: false
  915. },
  916. labelLine: {
  917. show: false
  918. }
  919. }
  920. }
  921. }, {
  922. name: '未使用',
  923. value: 100-txt
  924. }
  925. ]
  926. }]
  927. };
  928. // 使用刚指定的配置项和数据显示图表。
  929. myChart.setOption(option);
  930. window.addEventListener("resize",function(){
  931. myChart.resize();
  932. });
  933. }
  934. })