js.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809
  1.  $(window).load(function(){$(".loading").fadeOut()})
  2. $(function () {
  3. echarts_1();
  4. echarts_3();
  5. echarts_21();
  6. echarts_4();
  7. echarts_5();
  8. echarts_6();
  9. echarts_7();
  10. function echarts_1() {
  11. // 基于准备好的dom,初始化echarts实例
  12. var myChart = echarts.init(document.getElementById('echart1'));
  13. option = {
  14. tooltip: {
  15. trigger: 'axis',
  16. axisPointer: {
  17. type: 'shadow'
  18. }
  19. },
  20. legend: {
  21. data: ['业务1', '业务2', '业务3', '业务4'],
  22. left: 'center',
  23. textStyle: {color: "#fff"},
  24. },
  25. grid: {
  26. left: '0',
  27. top: '30',
  28. right: '10',
  29. bottom: '0',
  30. containLabel: true
  31. },
  32. xAxis: [{
  33. type: 'category',
  34. boundaryGap: false,
  35. data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  36. axisLine: {
  37. lineStyle: {
  38. color: 'rgba(255,255,255,0.12)'
  39. }
  40. },
  41. axisLabel: {
  42. // margin: 10,
  43. color: '#e2e9ff',
  44. textStyle: {
  45. fontSize: 14
  46. },
  47. },
  48. }],
  49. yAxis: [{
  50. splitNumber:3,
  51. axisLabel: {
  52. formatter: '{value}',
  53. color: '#e2e9ff',
  54. },
  55. axisLine: {
  56. show: false
  57. },
  58. splitLine: {
  59. lineStyle: {
  60. color: 'rgba(255,255,255,0.12)',
  61. type:'dotted'
  62. }
  63. }
  64. }],
  65. series: [
  66. {
  67. name: '业务1',
  68. type: 'line',
  69. smooth: true,
  70. symbol: 'circle',
  71. symbolSize: 5,
  72. showSymbol: false,
  73. lineStyle: {
  74. normal: {
  75. color: '#fbc20e',
  76. width: 2
  77. }
  78. },
  79. itemStyle: {normal: {color: '#fbc20e',}},
  80. data: [6, 2, 5, 1, 7, 4, 13, 4, 18, 6, 8, 4],
  81. },
  82. {
  83. name: '业务2',
  84. type: 'line',
  85. smooth: true,
  86. symbol: 'circle',
  87. symbolSize: 3,
  88. showSymbol: false,
  89. lineStyle: {
  90. normal: {
  91. color: '#f7717e',
  92. width: 2
  93. }
  94. },
  95. itemStyle: {normal: {color: '#f7717e',}},
  96. data: [4, 6, 4, 8, 6, 8, 4, 6, 2, 5, 1, 7 ],
  97. },
  98. {
  99. name: '业务3',
  100. type: 'line',
  101. smooth: true,
  102. symbol: 'circle',
  103. symbolSize: 3,
  104. showSymbol: false,
  105. lineStyle: {
  106. normal: {
  107. color: '#4670f4',
  108. width: 2
  109. }
  110. },
  111. itemStyle: {normal: {color: '#4670f4',}},
  112. data: [8, 6, 8, 4,4, 6, 5,4, 6, 2, 1, 7 ],
  113. },
  114. {
  115. name: '业务4',
  116. type: 'line',
  117. smooth: true,
  118. symbol: 'circle',
  119. symbolSize: 3,
  120. showSymbol: false,
  121. lineStyle: {
  122. normal: {
  123. color: '#64cd84',
  124. width: 2
  125. }
  126. },
  127. itemStyle: {normal: {color: '#64cd84',}},
  128. data: [8,4, 6, 5,4, 6, 2, 1, 7, 6, 8, 4 ],
  129. }
  130. ]
  131. };
  132. // 使用刚指定的配置项和数据显示图表。
  133. myChart.setOption(option);
  134. window.addEventListener("resize",function(){
  135. myChart.resize();
  136. });
  137. }
  138. function echarts_21() {
  139. // 基于准备好的dom,初始化echarts实例
  140. var myChart = echarts.init(document.getElementById('echart21'));
  141. var option = {
  142. grid: {
  143. top: '10',
  144. left: '0',
  145. right: '5%',
  146. bottom: '0',
  147. containLabel: true
  148. },
  149. yAxis: [{
  150. type: 'category',
  151. data: ['textone', 'textwo', 'texthree', 'textfour'],
  152. inverse: true,
  153. axisTick: { show: false},
  154. axisLabel: {
  155. textStyle: {
  156. color: 'rgba(255,255,255,.3)'
  157. }
  158. },
  159. axisLine: {
  160. show: false
  161. }
  162. }],
  163. xAxis: [{
  164. type: 'value',
  165. axisLabel: {
  166. show: false
  167. },
  168. axisLine: {
  169. show: false
  170. },
  171. splitLine: {
  172. show: false
  173. }
  174. }],
  175. series: [{
  176. type: 'bar',
  177. barWidth: 10,
  178. data: [100, 80, 70, 60],
  179. label: {
  180. normal: {
  181. show: true,
  182. position: 'insideBottomRight',
  183. formatter: '{c}%',
  184. distance: 0,
  185. offset: [10, -15],
  186. color: '#fff',
  187. fontSize: 12,
  188. padding: [2, 5, 2, 5],
  189. backgroundColor: {
  190. image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIwAAAA+CAYAAAD5wvNAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA0xp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onr5ZSz3CcjXTG71NoDoF1bGnsa5nqUtUptpeogZGOQ0t5zWNNcPnFYk5qTaXbAOjXBFnUQOOnvov96EKhOVy0I5h5/TqhXClOI+u4lcI/Qdty91QPDFXHoapEGUSeBd0UJyFKnRs/oV+5y1foZPQJATlANQVtmI2dw28Fmf5m3Fmq4s2cT7N/096gS1ts7HiLH/zKupBclmRrcP0NCq9ob9KnGfN6NOjnSX8nCcwDmRb/VW6zQWss4SfyCNxZlXqRLmcJ/wX9tEfqX/IBaN84RC0I8dj6Opm22xKo803sulziZtyqK91t9tmms2B0XO6Ppv4WhZ1W0zdJANjFzo6qJZod07o/Odlpq4wMHYOMRdLuBv6dB9d1vejrWYxMA46olhktrnsw8BYhPYeC3x6j84IvRADYxEPMlyfZHOdw8BYhHsElB5JtdAWh0JakBH9jGW4OJ9UN9GO3/wUYAAaXtVsjsG1HQAAAABJRU5ErkJggg=='
  191. }
  192. }
  193. },
  194. itemStyle: {
  195. normal: {
  196. color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
  197. offset: 0,
  198. color: '#57eabf' // 0% 处的颜色
  199. }, {
  200. offset: 1,
  201. color: '#2563f9' // 100% 处的颜色
  202. }], false),
  203. barBorderRadius: 14
  204. }
  205. }
  206. }, {
  207. type: "bar",
  208. barWidth: 10,
  209. xAxisIndex: 0,
  210. barGap: "-100%",
  211. data: [100, 100, 100, 100],
  212. itemStyle: {
  213. normal: {
  214. color: "#444a58",
  215. barBorderRadius: 14
  216. }
  217. },
  218. zlevel: -1
  219. }]
  220. };
  221. // 使用刚指定的配置项和数据显示图表。
  222. myChart.setOption(option);
  223. window.addEventListener("resize",function(){
  224. myChart.resize();
  225. });
  226. }
  227. function echarts_3() {
  228. // 基于准备好的dom,初始化echarts实例
  229. var myChart = echarts.init(document.getElementById('echart3'));
  230. var plantCap = [{
  231. name: '发明',
  232. value: '7'
  233. }, {
  234. name: '外观',
  235. value: '15'
  236. }, {
  237. name: '商标',
  238. value: '3'
  239. }, {
  240. name: '实用',
  241. value: '11'
  242. }, {
  243. name: '超市',
  244. value: '650'
  245. },{
  246. name: '软件',
  247. value: '7'
  248. }];
  249. var datalist = [{
  250. offset: [56, 48],
  251. symbolSize: 80,
  252. // opacity: .95,
  253. color: '#0050e4',
  254. }, {
  255. offset: [30, 70],
  256. symbolSize: 60,
  257. color: '#fc4322'
  258. }, {
  259. offset: [0, 43],
  260. symbolSize: 40,
  261. color: '#e18310'
  262. }, {
  263. offset: [93, 30],
  264. symbolSize: 60,
  265. color: '#08ba79'
  266. }, {
  267. offset: [26, 19],
  268. symbolSize: 55,
  269. color: '#069fc5'
  270. }, {
  271. offset: [75, 75],
  272. symbolSize: 40,
  273. color: '#e18310'
  274. }];
  275. var datas = [];
  276. for (var i = 0; i < plantCap.length; i++) {
  277. var item = plantCap[i];
  278. var itemToStyle = datalist[i];
  279. datas.push({
  280. name: item.value + '\n' + item.name,
  281. value: itemToStyle.offset,
  282. symbolSize: itemToStyle.symbolSize,
  283. itemStyle: {
  284. normal: {
  285. color: itemToStyle.color,
  286. opacity: itemToStyle.opacity
  287. }
  288. },
  289. })
  290. }
  291. option = {
  292. grid: {
  293. show: false,
  294. top: 10,
  295. bottom: 10
  296. },
  297. xAxis: [{
  298. gridIndex: 0,
  299. type: 'value',
  300. show: false,
  301. min: 0,
  302. max: 100,
  303. nameLocation: 'middle',
  304. nameGap: 5
  305. }],
  306. yAxis: [{
  307. gridIndex: 0,
  308. min: 0,
  309. show: false,
  310. max: 100,
  311. nameLocation: 'middle',
  312. nameGap: 30
  313. }],
  314. series: [{
  315. type: 'scatter',
  316. symbol: 'circle',
  317. symbolSize: 120,
  318. label: {
  319. normal: {
  320. show: true,
  321. formatter: '{b}',
  322. color: '#FFF',
  323. textStyle: {
  324. fontSize: '12'
  325. }
  326. },
  327. },
  328. data: datas
  329. }]
  330. };
  331. myChart.setOption(option);
  332. window.addEventListener("resize",function(){
  333. myChart.resize();
  334. });
  335. }
  336. function echarts_4() {
  337. // 基于准备好的dom,初始化echarts实例
  338. var myChart = echarts.init(document.getElementById('echart4'));
  339. option = {
  340. tooltip: {
  341. trigger: 'axis',
  342. axisPointer: {
  343. type: 'shadow'
  344. }
  345. },
  346. legend: {
  347. data: ['昨日', '今日'],
  348. left: 'center',
  349. textStyle: {color: "#fff"},
  350. },
  351. grid: {
  352. left: '0',
  353. top: '30',
  354. right: '10',
  355. bottom: '0',
  356. containLabel: true
  357. },
  358. xAxis: [{
  359. type: 'category',
  360. boundaryGap: false,
  361. data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  362. axisLine: {
  363. lineStyle: {
  364. color: 'rgba(255,255,255,0.12)'
  365. }
  366. },
  367. axisLabel: {
  368. // margin: 10,
  369. color: '#e2e9ff',
  370. textStyle: {
  371. fontSize: 14
  372. },
  373. },
  374. }],
  375. yAxis: [{
  376. splitNumber:3,
  377. axisLabel: {
  378. formatter: '{value}',
  379. color: '#e2e9ff',
  380. },
  381. axisLine: {
  382. show: false
  383. },
  384. splitLine: {
  385. lineStyle: {
  386. color: 'rgba(255,255,255,0.12)',
  387. type:'dotted'
  388. }
  389. }
  390. }],
  391. series: [
  392. {
  393. name: '昨日',
  394. type: 'line',
  395. // smooth: true,
  396. symbol: 'circle',
  397. symbolSize: 5,
  398. showSymbol: false,
  399. lineStyle: {
  400. normal: {
  401. color: '#fbc20e',
  402. width: 2
  403. }
  404. },
  405. itemStyle: {normal: {color: '#fbc20e',}},
  406. data: [6, 2, 5, 1, 7, 4, 13, 4, 18, 6, 8, 4],
  407. },
  408. {
  409. name: '今日',
  410. type: 'line',
  411. // smooth: true,
  412. symbol: 'circle',
  413. symbolSize: 3,
  414. showSymbol: false,
  415. lineStyle: {
  416. normal: {
  417. color: '#58c8da',
  418. width: 2
  419. }
  420. },
  421. itemStyle: {normal: {color: '#58c8da',}},
  422. data: [4, 6, 4, 8, 6, 8, 4, 6, 2, 5, 1, 7 ],
  423. }
  424. ]
  425. };
  426. // 使用刚指定的配置项和数据显示图表。
  427. myChart.setOption(option);
  428. window.addEventListener("resize",function(){
  429. myChart.resize();
  430. });
  431. }
  432. function echarts_5() {
  433. var myChart = echarts.init(document.getElementById('echart5'));
  434. option = {
  435. tooltip: {
  436. trigger: 'axis',
  437. axisPointer: {
  438. type: 'shadow'
  439. }
  440. },
  441. legend: {
  442. data: ['昨日', '今日'],
  443. left: 'center',
  444. textStyle: {color: "#fff"},
  445. },
  446. grid: {
  447. left: '0',
  448. top: '30',
  449. right: '10',
  450. bottom: '0',
  451. containLabel: true
  452. },
  453. xAxis: [{
  454. type: 'category',
  455. boundaryGap: false,
  456. data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  457. axisLine: {
  458. lineStyle: {
  459. color: 'rgba(255,255,255,0.12)'
  460. }
  461. },
  462. axisLabel: {
  463. // margin: 10,
  464. color: '#e2e9ff',
  465. textStyle: {
  466. fontSize: 14
  467. },
  468. },
  469. }],
  470. yAxis: [{
  471. splitNumber:3,
  472. axisLabel: {
  473. formatter: '{value}',
  474. color: '#e2e9ff',
  475. },
  476. axisLine: {
  477. show: false
  478. },
  479. splitLine: {
  480. lineStyle: {
  481. color: 'rgba(255,255,255,0.12)',
  482. type:'dotted'
  483. }
  484. }
  485. }],
  486. series: [
  487. {
  488. name: '昨日',
  489. type: 'line',
  490. // smooth: true,
  491. symbol: 'circle',
  492. symbolSize: 5,
  493. showSymbol: false,
  494. lineStyle: {
  495. normal: {
  496. color: '#fbc20e',
  497. width: 2
  498. }
  499. },
  500. itemStyle: {normal: {color: '#fbc20e',}},
  501. data: [8, 6, 8, 4,4, 6, 5,4, 6, 2, 1, 7 ],
  502. },
  503. {
  504. name: '今日',
  505. type: 'line',
  506. // smooth: true,
  507. symbol: 'circle',
  508. symbolSize: 3,
  509. showSymbol: false,
  510. lineStyle: {
  511. normal: {
  512. color: '#58c8da',
  513. width: 2
  514. }
  515. },
  516. itemStyle: {normal: {color: '#58c8da',}},
  517. data: [8,4, 6, 5,4, 6, 2, 1, 7, 6, 8, 4 ],
  518. }
  519. ]
  520. };
  521. myChart.setOption(option);
  522. window.addEventListener("resize",function(){
  523. myChart.resize();
  524. });
  525. }
  526. function echarts_6() {
  527. var myChart = echarts.init(document.getElementById('echart6'));
  528. option = {
  529. tooltip: {
  530. trigger: 'axis',
  531. axisPointer: {
  532. type: 'shadow'
  533. }
  534. },
  535. color: ["#248ff7",'#64cd84'],
  536. legend: {
  537. data: ['系统外部', '系统内部'],
  538. left: 'center',
  539. textStyle: {color: "#fff"},
  540. itemWidth: 15,
  541. itemHeight: 10,
  542. },
  543. grid: {
  544. left: '0',
  545. top: '30',
  546. right: '10',
  547. bottom: '0',
  548. containLabel: true
  549. },
  550. xAxis: [{
  551. type: 'category',
  552. // boundaryGap: false,
  553. data: ['1', '2', '3', '4', '5'],
  554. axisLine: {
  555. lineStyle: {
  556. color: 'rgba(255,255,255,0.12)'
  557. }
  558. },
  559. axisLabel: {
  560. // margin: 10,
  561. color: '#e2e9ff',
  562. textStyle: {
  563. fontSize: 14
  564. },
  565. },
  566. }],
  567. yAxis: [{
  568. splitNumber:3,
  569. axisLabel: {
  570. formatter: '{value}',
  571. color: '#e2e9ff',
  572. },
  573. axisLine: {
  574. show: false
  575. },
  576. splitLine: {
  577. lineStyle: {
  578. color: 'rgba(255,255,255,0.12)',
  579. type:'dotted'
  580. }
  581. }
  582. }],
  583. series : [
  584. {
  585. name:'系统外部',
  586. type:'bar',
  587. stack: '排名',
  588. data:[120, 132, 101, 134, 90],
  589. barWidth:15
  590. },
  591. {
  592. name:'系统内部',
  593. type:'bar',
  594. stack: '排名',
  595. data:[220, 182, 191, 234, 290],
  596. barWidth:15,
  597. itemStyle:{
  598. normal:{
  599. barBorderRadius: [30, 30, 0, 0],
  600. }
  601. }
  602. },
  603. ]
  604. };
  605. myChart.setOption(option);
  606. window.addEventListener("resize",function(){
  607. myChart.resize();
  608. });
  609. }
  610. function echarts_7() {
  611. var myChart = echarts.init(document.getElementById('echart7'));
  612. option = {
  613. tooltip: {
  614. trigger: 'axis',
  615. axisPointer: {
  616. type: 'shadow'
  617. }
  618. },
  619. legend: {
  620. data: ['昨日', '今日','平均'],
  621. left: 'center',
  622. textStyle: {color: "#fff"},
  623. },
  624. grid: {
  625. left: '0',
  626. top: '30',
  627. right: '10',
  628. bottom: '0',
  629. containLabel: true
  630. },
  631. xAxis: [{
  632. type: 'category',
  633. boundaryGap: false,
  634. data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  635. axisLine: {
  636. lineStyle: {
  637. color: 'rgba(255,255,255,0.12)'
  638. }
  639. },
  640. axisLabel: {
  641. // margin: 10,
  642. color: '#e2e9ff',
  643. textStyle: {
  644. fontSize: 14
  645. },
  646. },
  647. }],
  648. yAxis: [{
  649. splitNumber:3,
  650. axisLabel: {
  651. formatter: '{value}',
  652. color: '#e2e9ff',
  653. },
  654. axisLine: {
  655. show: false
  656. },
  657. splitLine: {
  658. lineStyle: {
  659. color: 'rgba(255,255,255,0.12)',
  660. type:'dotted'
  661. }
  662. }
  663. }],
  664. series: [
  665. {
  666. name: '昨日',
  667. type: 'line',
  668. // smooth: true,
  669. symbol: 'circle',
  670. symbolSize: 5,
  671. showSymbol: false,
  672. areaStyle: {
  673. normal: {
  674. color: 'rgba(101,192,205,.3)'
  675. }
  676. },
  677. lineStyle: {
  678. normal: {
  679. color: '#58c8da',
  680. width: 2
  681. }
  682. },
  683. itemStyle: {normal: {color: '#58c8da',}},
  684. data: [8, 6, 8, 4,4, 6, 2,4, 6, 5, 1, 7 ],
  685. },
  686. {
  687. name: '今日',
  688. type: 'line',
  689. // smooth: true,
  690. symbol: 'circle',
  691. symbolSize: 3,
  692. showSymbol: false,
  693. areaStyle: {
  694. normal: {
  695. color: 'rgba(218,179,101,.3)'
  696. }
  697. },
  698. lineStyle: {
  699. normal: {
  700. color: '#f7b851',
  701. width: 2
  702. }
  703. },
  704. itemStyle: {normal: {color: '#f7b851',}},
  705. data: [8, 4, 6, 7, 6, 8, 4, 5, 4, 6, 2, 6 ],
  706. },
  707. {
  708. name: '平均',
  709. type: 'line',
  710. // smooth: true,
  711. symbol: 'circle',
  712. symbolSize: 3,
  713. showSymbol: false,
  714. lineStyle: {
  715. normal: {
  716. color: '#fff',
  717. width: 1,
  718. type:'dotted'
  719. }
  720. },
  721. itemStyle: {normal: {color: '#fff',}},
  722. data: [5,5, 5, 5,5, 5, 5, 5, 5, 5, 5, 5 ],
  723. }
  724. ]
  725. };
  726. myChart.setOption(option);
  727. window.addEventListener("resize",function(){
  728. myChart.resize();
  729. });
  730. }
  731. })