visualizedCharts2.js 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105
  1. //定义图表对象
  2. var myChart1 = null;
  3. var myChart2 = null;
  4. var myChart3 = null;
  5. var myChart4 = null;
  6. var myChart5 = null;
  7. var myChart6 = null;
  8. var myChart7 = null;
  9. $(function(){
  10. industryBar();
  11. changeChart();
  12. ageTrendPie();
  13. skillAcquisitionChart();
  14. playCounts();
  15. roseChart();
  16. moveMapChart();
  17. clocknum(2060,'requiredPeoples'); //执行
  18. clocknum(6990,'supplyPeoples');
  19. /* $(".digits").numScroll({
  20. time:5000
  21. });*/
  22. });
  23. /**
  24. * 柱形图
  25. */
  26. function industryBar(){
  27. var xAxisData = ['美术学院', '音乐学院', '影视学院', '电商学院', '旅游学院'];
  28. var yAxisData = [200, 300, 300, 900, 1500];
  29. myChart1 = echarts.init(document.getElementById('industryBar')); // 基于准备好的dom,初始化echarts实例
  30. var option = {
  31. title: {
  32. text: '院系报到数据',
  33. left: 'center',
  34. textStyle:{color:'#fff'},
  35. top:'4%',
  36. },
  37. tooltip: {
  38. trigger: 'axis',
  39. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  40. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  41. }
  42. },
  43. grid: {
  44. left: '2%',
  45. right: '4%',
  46. top:'20%',
  47. bottom: '3%',
  48. containLabel: true
  49. },
  50. xAxis: [
  51. {
  52. type: 'category',
  53. data: xAxisData,
  54. axisTick: {
  55. alignWithLabel: true
  56. },
  57. axisLabel: { //x轴文字颜色
  58. color: '#fff'
  59. },
  60. axisLine: { //x轴线的颜色
  61. lineStyle:{
  62. color: ['#fff'],
  63. width: 1,
  64. type: 'solid',
  65. opacity: 0.1
  66. }
  67. }
  68. }
  69. ],
  70. yAxis: [
  71. {
  72. type: 'value',
  73. axisLabel: { //y轴文字颜色
  74. color: '#fff'
  75. },
  76. axisLine: { //y轴线的颜色
  77. lineStyle:{
  78. color: ['#fff'],
  79. width: 1,
  80. type: 'solid',
  81. opacity: 0.1
  82. }
  83. },
  84. splitLine: { //网格样式
  85. show: true,
  86. lineStyle:{
  87. color: 'rgba(255,255,255,0.3)',
  88. width: 1,
  89. type: 'dashed'
  90. }
  91. }
  92. }
  93. ],
  94. series: [
  95. {
  96. // name: '直接访问',
  97. type: 'bar',
  98. barWidth: '50%',
  99. itemStyle: {
  100. normal: {
  101. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  102. offset: 0,
  103. color: '#248ff7'
  104. }, {
  105. offset: 1,
  106. color: '#6851f1'
  107. }]),
  108. barBorderRadius: 11,
  109. }
  110. },
  111. data:yAxisData
  112. }
  113. ]
  114. };
  115. myChart1.setOption(option,true); // 使用刚指定的配置项和数据显示图表。
  116. var app = {
  117. currentIndex: -1,
  118. };
  119. setInterval(function () {
  120. var dataLen = option.series[0].data.length;
  121. // 取消之前高亮的图形
  122. myChart1.dispatchAction({
  123. type: 'downplay',
  124. seriesIndex: 0,
  125. dataIndex: app.currentIndex
  126. });
  127. app.currentIndex = (app.currentIndex + 1) % dataLen;
  128. //console.log(app.currentIndex);
  129. // 高亮当前图形
  130. myChart1.dispatchAction({
  131. type: 'highlight',
  132. seriesIndex: 0,
  133. dataIndex: app.currentIndex,
  134. });
  135. // 显示 tooltip
  136. myChart1.dispatchAction({
  137. type: 'showTip',
  138. seriesIndex: 0,
  139. dataIndex: app.currentIndex
  140. });
  141. }, 3000);
  142. $(document).ready(function(){
  143.   myChart1.resize();
  144. })
  145. window.addEventListener("resize", function () {
  146.   myChart1.resize();
  147. });
  148. }
  149. /**
  150. *折线图
  151. */
  152. function changeChart(){
  153. myChart2 = echarts.init(document.getElementById('changeLine'));
  154. var option = {
  155. title: {
  156. text: '男女比例',
  157. left: 'center',
  158. textStyle: {color: '#fff'},
  159. top:'4%',
  160. },
  161. grid: {
  162. left: '2%',
  163. right: '4%',
  164. top:'25%',
  165. bottom: '3%',
  166. containLabel: true
  167. },
  168. legend: {
  169. data: ['男', '女'],
  170. textStyle: {color: '#fff'},
  171. right: '4%',
  172. top:'3%',
  173. bottom: '5%',
  174. },
  175. xAxis: {
  176. type: 'category',
  177. data: ['美术学院', '音乐学院', '影视学院', '电商学院', '旅游学院'],
  178. axisLabel: { //x轴文字颜色
  179. color: '#fff'
  180. },
  181. axisLine: { //x轴线的颜色
  182. lineStyle:{
  183. color: ['#fff'],
  184. width: 1,
  185. type: 'solid',
  186. opacity: 0.1
  187. }
  188. }
  189. },
  190. yAxis: {
  191. type: 'value',
  192. axisLabel: { //x轴文字颜色
  193. color: '#fff'
  194. },
  195. axisLine: { //x轴线的颜色
  196. lineStyle:{
  197. color: ['#fff'],
  198. width: 1,
  199. type: 'solid',
  200. opacity: 0.1
  201. }
  202. },
  203. splitLine: { //网格样式
  204. show: true,
  205. lineStyle:{
  206. color: 'rgba(255,255,255,0.1)',
  207. width: 1,
  208. type: 'dashed'
  209. }
  210. }
  211. },
  212. color:['#01dee1',"#ed3f35"], //曲线颜色
  213. series: [ {
  214. name: '男',
  215. type: 'line',
  216. data: [47, 50,100, 140, 95, 220, 201,240,230,125,245,202,125],
  217. smooth: true,//平滑曲线
  218. markPoint: {
  219. data: [
  220. {type: 'max', name: '最大值'},
  221. {type: 'min', name: '最小值'}
  222. ]
  223. }
  224. },{
  225. name: '女',
  226. type: 'line',
  227. data: [149, 138, 160, 130, 180, 28, 90,60,49,54,28,45],
  228. smooth: true, //平滑曲线
  229. markPoint: {
  230. data: [
  231. {type: 'max', name: '最大值'},
  232. {type: 'min', name: '最小值'}
  233. ]
  234. }
  235. }]
  236. };
  237. myChart2.setOption(option,true); // 使用刚指定的配置项和数据显示图表。
  238. $(document).ready(function(){
  239.   myChart2.resize();
  240. })
  241. window.addEventListener("resize", function () {
  242.   myChart2.resize();
  243. });
  244. }
  245. /**
  246. *饼形图
  247. */
  248. function ageTrendPie(){
  249. myChart3 = echarts.init(document.getElementById('agePie'));
  250. var option = {
  251. title: {
  252. text: '年龄分析',
  253. left: 'center',
  254. textStyle: {color: '#fff'},
  255. top:'4%',
  256. },
  257. tooltip: {
  258. trigger: 'item',
  259. formatter: '{a} <br/>{b}: {c} ({d}%)'
  260. },
  261. grid: {
  262. left: '3%',
  263. right: '4%',
  264. top:'35%',
  265. bottom: '3%'
  266. },
  267. legend: {
  268. orient: 'vertical',
  269. left: 10,
  270. data: ['16岁', '17岁','18岁','19岁','20岁','21岁以上'],
  271. textStyle: {
  272. color: '#fff'
  273. }
  274. },
  275. series: [
  276. {
  277. name: '年龄占比',
  278. type: 'pie',
  279. radius: ['50%', '70%'],
  280. avoidLabelOverlap: true,
  281. label: {
  282. show: false,
  283. position: 'center'
  284. },
  285. emphasis: {
  286. label: {
  287. show: true,
  288. fontSize: '30',
  289. fontWeight: 'bold'
  290. }
  291. },
  292. labelLine: {
  293. show: false
  294. },
  295. itemStyle: {
  296. normal: {
  297. label:{
  298. show: true,
  299. formatter: '{b} \n ({d}%)'
  300. }
  301. }
  302. },
  303. color:['#10606b','#0696ab','#06a0ab','#86c9f4','#4da8ec','#3a91d2','#005fa6','#315f97'],
  304. data: [
  305. {value: 999, name: '16岁'},
  306. {value: 2000, name: '17岁'},
  307. {value: 1548, name: '18岁'},
  308. {value: 1548, name: '19岁'},
  309. {value: 1548, name: '20岁'},
  310. {value: 1548, name: '21岁以上'}
  311. ]
  312. }
  313. ]
  314. };
  315. myChart3.setOption(option,true); // 使用刚指定的配置项和数据显示图表。
  316. $(document).ready(function(){
  317.   myChart3.resize();
  318. })
  319. window.addEventListener("resize", function () {
  320.   myChart3.resize();
  321. });
  322. }
  323. /**
  324. *柱形图
  325. */
  326. function skillAcquisitionChart(){
  327. var cost = [69, 78, 60,34, 70]//本期比上期(大于1按1处理)
  328. var totalCost = [ 100,100, 100, 100,100]//比例综合
  329. var visits = [ 664,793, 610, 350,"39/702"]//本期占总的百分比*100
  330. var grade = ['医务室','保卫处', '组织部','学工部','公寓' ]
  331. var myColor = ['#21BF57','#56D0E3', '#1089E7', '#F8B448','#F57474', ];
  332. var data = {
  333. grade: grade,
  334. cost: cost,
  335. totalCost: totalCost,
  336. visits: visits
  337. };
  338. var option = {
  339. title: {
  340. top: '4%',
  341. left: 'center',
  342. text: '节点报到数据',
  343. textStyle: {
  344. align: 'center',
  345. color:'#fff'
  346. }
  347. },
  348. grid: {
  349. left: '130',
  350. right: '100',
  351. bottom: '20'
  352. },
  353. xAxis: {
  354. show: false,
  355. },
  356. yAxis: {
  357. type: 'category',
  358. axisLabel: {
  359. margin:30,
  360. show: true,
  361. color: '#4DCEF8',
  362. fontSize: 14
  363. },
  364. axisTick: {
  365. show: false,
  366. },
  367. axisLine: {
  368. show: false,
  369. },
  370. data: data.grade
  371. },
  372. series: [{//外层边框
  373. type: 'bar',
  374. barGap: '-65%',
  375. label: {
  376. normal: {
  377. show: true,
  378. position: 'right',
  379. color: '#fff',
  380. fontSize: 14,
  381. formatter:
  382. function(param) {
  383. return data.visits[param.dataIndex];
  384. },
  385. }
  386. },
  387. barWidth: '30%',
  388. itemStyle: {
  389. normal: {
  390. borderColor: '#4DCEF8',
  391. borderWidth: 2,
  392. barBorderRadius: 15,
  393. color: 'rgba(102, 102, 102,0)'
  394. },
  395. },
  396. z: 1,
  397. data: data.totalCost,
  398. // data: da
  399. }, {//柱形图占比
  400. type: 'bar',
  401. barGap: '-85%',
  402. barWidth: '21%',
  403. itemStyle: {
  404. normal: {
  405. barBorderRadius: 16,
  406. color: function(params) {
  407. var num = myColor.length;
  408. return myColor[params.dataIndex % num]
  409. },
  410. }
  411. },
  412. max: 1,
  413. label: {
  414. normal: {
  415. show: true,
  416. position: 'inside',
  417. formatter: '{c}%'
  418. }
  419. },
  420. labelLine: {
  421. show: true,
  422. },
  423. z: 2,
  424. data: data.cost,
  425. }]
  426. }
  427. myChart4 = echarts.init(document.getElementById('skillAcquisitionBar'));
  428. myChart4.setOption(option,true);
  429. $(document).ready(function(){
  430.   myChart4.resize();
  431. })
  432. window.addEventListener("resize", function () {
  433.   myChart4.resize();
  434. });
  435. }
  436. /**
  437. *折线图
  438. */
  439. function playCounts(){
  440. let bgColor = "#fff";
  441. let color = [
  442. "#0090FF",
  443. "#36CE9E",
  444. "#FFC005",
  445. "#FF515A",
  446. "#8B5CFF",
  447. "#00CA69"
  448. ];
  449. let echartData = [{
  450. name: "1",
  451. value1: 100,
  452. value2: 233
  453. },
  454. {
  455. name: "2",
  456. value1: 138,
  457. value2: 233
  458. },
  459. {
  460. name: "3",
  461. value1: 280,
  462. value2: 200
  463. },
  464. {
  465. name: "4",
  466. value1: 173,
  467. value2: 180
  468. },
  469. {
  470. name: "5",
  471. value1: 180,
  472. value2: 199
  473. },
  474. {
  475. name: "6",
  476. value1: 180,
  477. value2: 133
  478. },
  479. {
  480. name: "7",
  481. value1: 180,
  482. value2: 210
  483. },
  484. {
  485. name: "8",
  486. value1: 190,
  487. value2: 150
  488. },
  489. {
  490. name: "9",
  491. value1: 160,
  492. value2: 180
  493. },
  494. {
  495. name: "10",
  496. value1: 230,
  497. value2: 180
  498. },
  499. {
  500. name: "11",
  501. value1: 130,
  502. value2: 100
  503. },
  504. {
  505. name: "12",
  506. value1: 80,
  507. value2: 180
  508. },
  509. ];
  510. let xAxisData = echartData.map(v => v.name);
  511. //  ["1", "2", "3", "4", "5", "6", "7", "8"]
  512. let yAxisData1 = echartData.map(v => v.value1);
  513. // [100, 138, 350, 173, 180, 150, 180, 230]
  514. let yAxisData2 = echartData.map(v => v.value2);
  515. // [233, 233, 200, 180, 199, 233, 210, 180]
  516. const hexToRgba = (hex, opacity) => {
  517. let rgbaColor = "";
  518. let reg = /^#[\da-f]{6}$/i;
  519. if (reg.test(hex)) {
  520. rgbaColor = `rgba(${parseInt("0x" + hex.slice(1, 3))},${parseInt(
  521. "0x" + hex.slice(3, 5)
  522. )},${parseInt("0x" + hex.slice(5, 7))},${opacity})`;
  523. }
  524. return rgbaColor;
  525. }
  526. /////////////////////
  527. var option = {
  528. title: {
  529. top: '4%',
  530. left: 'center',
  531. text: '图 ',
  532. textStyle: {
  533. align: 'center',
  534. color:'#fff'
  535. }
  536. },
  537. legend: {
  538. right: 10,
  539. top: 10,
  540. textStyle: {
  541. color: "#fff"
  542. }
  543. },
  544. tooltip: {
  545. trigger: "axis",
  546. formatter: function(params) {
  547. let html = '';
  548. params.forEach(v => {
  549. console.log(v)
  550. html += `<div style="color: #666;font-size: 14px;line-height: 24px">
  551. <span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${color[v.componentIndex]};"></span>
  552. ${v.seriesName}.${v.name}
  553. <span style="color:${color[v.componentIndex]};font-weight:700;font-size: 18px">${v.value}</span>
  554. 万元`;
  555. })
  556. return html
  557. },
  558. extraCssText: 'border-radius: 0;box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);color: #333;',
  559. axisPointer: {
  560. type: 'shadow',
  561. shadowStyle: {
  562. color: '#ffffff',
  563. shadowColor: 'rgba(225,225,225,1)',
  564. shadowBlur: 5
  565. }
  566. }
  567. },
  568. grid: {
  569. top: 70,
  570. bottom:10,
  571. containLabel: true
  572. },
  573. xAxis: [{
  574. type: "category",
  575. boundaryGap: false,
  576. axisLabel: {
  577. formatter: '{value}月',
  578. textStyle: {
  579. color: "#fff",
  580. opacity: 1
  581. }
  582. },
  583. axisLine: {
  584. lineStyle: {
  585. color: "#D9D9D9"
  586. }
  587. },
  588. data: xAxisData
  589. }],
  590. yAxis: [{
  591. type: "value",
  592. //name: '单位:人 ',
  593. axisLabel: {
  594. textStyle: {
  595. color: "#fff"
  596. }
  597. },
  598. nameTextStyle: {
  599. color: "#fff",
  600. fontSize: 12,
  601. lineHeight: 40
  602. },
  603. splitLine: { //网格样式
  604. show: true,
  605. lineStyle:{
  606. color: 'rgba(255,255,255,0.1)',
  607. width: 1,
  608. type: 'dashed'
  609. }
  610. },
  611. axisLine: {
  612. show: false
  613. },
  614. axisTick: {
  615. show: false
  616. }
  617. }],
  618. series: [{
  619. name: "硕士",
  620. type: "line",
  621. smooth: true,
  622. // showSymbol: false,/
  623. symbolSize: 8,
  624. zlevel: 3,
  625. lineStyle: {
  626. normal: {
  627. color: color[0],
  628. shadowBlur: 3,
  629. shadowColor: hexToRgba(color[0], 0.5),
  630. shadowOffsetY: 8
  631. }
  632. },
  633. areaStyle: {
  634. normal: {
  635. color: new echarts.graphic.LinearGradient(
  636. 0,
  637. 0,
  638. 0,
  639. 1,
  640. [{
  641. offset: 0,
  642. color: hexToRgba(color[0], 0.3)
  643. },
  644. {
  645. offset: 1,
  646. color: hexToRgba(color[0], 0.1)
  647. }
  648. ],
  649. false
  650. ),
  651. shadowColor: hexToRgba(color[0], 0.1),
  652. shadowBlur: 10
  653. }
  654. },
  655. data: yAxisData1
  656. }, {
  657. name: "博士",
  658. type: "line",
  659. smooth: true,
  660. // showSymbol: false,
  661. symbolSize: 8,
  662. zlevel: 3,
  663. lineStyle: {
  664. normal: {
  665. color: color[1],
  666. shadowBlur: 3,
  667. shadowColor: hexToRgba(color[1], 0.5),
  668. shadowOffsetY: 8
  669. }
  670. },
  671. areaStyle: {
  672. normal: {
  673. color: new echarts.graphic.LinearGradient(
  674. 0,
  675. 0,
  676. 0,
  677. 1,
  678. [{
  679. offset: 0,
  680. color: hexToRgba(color[1], 0.3)
  681. },
  682. {
  683. offset: 1,
  684. color: hexToRgba(color[1], 0.1)
  685. }
  686. ],
  687. false
  688. ),
  689. shadowColor: hexToRgba(color[1], 0.1),
  690. shadowBlur: 10
  691. }
  692. },
  693. data: yAxisData2
  694. }]
  695. };
  696. myChart5 = echarts.init(document.getElementById('playCounts'));
  697. myChart5.setOption(option,true);
  698. $(document).ready(function(){
  699.   myChart5.resize();
  700. })
  701. window.addEventListener("resize", function () {
  702.   myChart5.resize();
  703. });
  704. }
  705. /**
  706. * 玫瑰图-地区分布
  707. */
  708. function roseChart(){
  709. var option = {
  710. color:['#1d9dff','#006cff','#60cda0','#ed8884','#8b78f6','#3a91d2','#06a0ab','#86c9f4'],
  711. title: {
  712. text: '地区分布',
  713. left: 'center',
  714. top:'4%',
  715. textStyle: {
  716. color: '#fff'
  717. }
  718. },
  719. tooltip: {
  720. trigger: 'item',
  721. formatter: '{a} <br/>{b} : {c} ({d}%)'
  722. },
  723. legend: {
  724. left: 'center',
  725. top: 'bottom',
  726. data: ['北京', '天津', '上海', '深圳', '广州', '厦门', '珠海', '西安'],
  727. textStyle: {
  728. color: '#fff'
  729. }
  730. },
  731. toolbox: {
  732. show: true,
  733. feature: {
  734. mark: {show: true},
  735. dataView: {show: true, readOnly: false},
  736. magicType: {
  737. show: true,
  738. type: ['pie', 'funnel']
  739. },
  740. restore: {show: true},
  741. saveAsImage: {show: true}
  742. }
  743. },
  744. series: [
  745. {
  746. name: '半径模式',
  747. type: 'pie',
  748. radius: [15, 90],
  749. center: ['50%', '50%'],
  750. roseType: 'radius',
  751. label: {
  752. show: true
  753. },
  754. emphasis: {
  755. label: {
  756. show: true
  757. }
  758. },
  759. data: [
  760. {value: 10, name: '北京'},
  761. {value: 15, name: '天津'},
  762. {value: 15, name: '上海'},
  763. {value: 25, name: '深圳'},
  764. {value: 20, name: '广州'},
  765. {value: 35, name: '厦门'},
  766. {value: 30, name: '珠海'},
  767. {value: 40, name: '西安'}
  768. ]
  769. }
  770. ]
  771. };
  772. myChart6 = echarts.init(document.getElementById('roseChart'));
  773. myChart6.setOption(option);
  774. $(document).ready(function(){
  775.   myChart6.resize();
  776. })
  777. window.addEventListener("resize", function () {
  778.   myChart6.resize();
  779. });
  780. }
  781. /**
  782. * 迁徙图
  783. */
  784. function moveMapChart(){
  785. var geoCoordMap = {
  786. '上海': [121.4648,31.2891],
  787. '东莞': [113.8953,22.901],
  788. '东营': [118.7073,37.5513],
  789. '中山': [113.4229,22.478],
  790. '临汾': [111.4783,36.1615],
  791. '临沂': [118.3118,35.2936],
  792. '丹东': [124.541,40.4242],
  793. '丽水': [119.5642,28.1854],
  794. '乌鲁木齐': [87.9236,43.5883],
  795. '佛山': [112.8955,23.1097],
  796. '保定': [115.0488,39.0948],
  797. '兰州': [103.5901,36.3043],
  798. '包头': [110.3467,41.4899],
  799. '北京': [116.4551,40.2539],
  800. '北海': [109.314,21.6211],
  801. '南京': [118.8062,31.9208],
  802. '南宁': [108.479,23.1152],
  803. '南昌': [116.0046,28.6633],
  804. '南通': [121.1023,32.1625],
  805. '厦门': [118.1689,24.6478],
  806. '台州': [121.1353,28.6688],
  807. '合肥': [117.29,32.0581],
  808. '呼和浩特': [111.4124,40.4901],
  809. '咸阳': [108.4131,34.8706],
  810. '哈尔滨': [127.9688,45.368],
  811. '唐山': [118.4766,39.6826],
  812. '嘉兴': [120.9155,30.6354],
  813. '大同': [113.7854,39.8035],
  814. '大连': [122.2229,39.4409],
  815. '天津': [117.4219,39.4189],
  816. '太原': [112.3352,37.9413],
  817. '威海': [121.9482,37.1393],
  818. '宁波': [121.5967,29.6466],
  819. '宝鸡': [107.1826,34.3433],
  820. '宿迁': [118.5535,33.7775],
  821. '常州': [119.4543,31.5582],
  822. '广州': [113.5107,23.2196],
  823. '廊坊': [116.521,39.0509],
  824. '延安': [109.1052,36.4252],
  825. '张家口': [115.1477,40.8527],
  826. '徐州': [117.5208,34.3268],
  827. '德州': [116.6858,37.2107],
  828. '惠州': [114.6204,23.1647],
  829. '成都': [103.9526,30.7617],
  830. '扬州': [119.4653,32.8162],
  831. '承德': [117.5757,41.4075],
  832. '拉萨': [91.1865,30.1465],
  833. '无锡': [120.3442,31.5527],
  834. '日照': [119.2786,35.5023],
  835. '昆明': [102.9199,25.4663],
  836. '杭州': [119.5313,29.8773],
  837. '枣庄': [117.323,34.8926],
  838. '柳州': [109.3799,24.9774],
  839. '株洲': [113.5327,27.0319],
  840. '武汉': [114.3896,30.6628],
  841. '汕头': [117.1692,23.3405],
  842. '江门': [112.6318,22.1484],
  843. '沈阳': [123.1238,42.1216],
  844. '沧州': [116.8286,38.2104],
  845. '河源': [114.917,23.9722],
  846. '泉州': [118.3228,25.1147],
  847. '泰安': [117.0264,36.0516],
  848. '泰州': [120.0586,32.5525],
  849. '济南': [117.1582,36.8701],
  850. '济宁': [116.8286,35.3375],
  851. '海口': [110.3893,19.8516],
  852. '淄博': [118.0371,36.6064],
  853. '淮安': [118.927,33.4039],
  854. '深圳': [114.5435,22.5439],
  855. '清远': [112.9175,24.3292],
  856. '温州': [120.498,27.8119],
  857. '渭南': [109.7864,35.0299],
  858. '湖州': [119.8608,30.7782],
  859. '湘潭': [112.5439,27.7075],
  860. '滨州': [117.8174,37.4963],
  861. '潍坊': [119.0918,36.524],
  862. '烟台': [120.7397,37.5128],
  863. '玉溪': [101.9312,23.8898],
  864. '珠海': [113.7305,22.1155],
  865. '盐城': [120.2234,33.5577],
  866. '盘锦': [121.9482,41.0449],
  867. '石家庄': [114.4995,38.1006],
  868. '福州': [119.4543,25.9222],
  869. '秦皇岛': [119.2126,40.0232],
  870. '绍兴': [120.564,29.7565],
  871. '聊城': [115.9167,36.4032],
  872. '肇庆': [112.1265,23.5822],
  873. '舟山': [122.2559,30.2234],
  874. '苏州': [120.6519,31.3989],
  875. '莱芜': [117.6526,36.2714],
  876. '菏泽': [115.6201,35.2057],
  877. '营口': [122.4316,40.4297],
  878. '葫芦岛': [120.1575,40.578],
  879. '衡水': [115.8838,37.7161],
  880. '衢州': [118.6853,28.8666],
  881. '西宁': [101.4038,36.8207],
  882. '西安': [109.1162,34.2004],
  883. '贵阳': [106.6992,26.7682],
  884. '连云港': [119.1248,34.552],
  885. '邢台': [114.8071,37.2821],
  886. '邯郸': [114.4775,36.535],
  887. '郑州': [113.4668,34.6234],
  888. '鄂尔多斯': [108.9734,39.2487],
  889. '重庆': [107.7539,30.1904],
  890. '金华': [120.0037,29.1028],
  891. '铜川': [109.0393,35.1947],
  892. '银川': [106.3586,38.1775],
  893. '镇江': [119.4763,31.9702],
  894. '长春': [125.8154,44.2584],
  895. '长沙': [113.0823,28.2568],
  896. '长治': [112.8625,36.4746],
  897. '阳泉': [113.4778,38.0951],
  898. '青岛': [120.4651,36.3373],
  899. '韶关': [113.7964,24.7028]
  900. };
  901. var BJData = [
  902. [{name:'北京'}, {name:'上海',value:95}],
  903. [{name:'北京'}, {name:'广州',value:90}],
  904. [{name:'北京'}, {name:'大连',value:80}],
  905. [{name:'北京'}, {name:'南宁',value:70}],
  906. [{name:'北京'}, {name:'南昌',value:60}],
  907. [{name:'北京'}, {name:'拉萨',value:50}],
  908. [{name:'北京'}, {name:'长春',value:40}],
  909. [{name:'北京'}, {name:'包头',value:30}],
  910. [{name:'北京'}, {name:'重庆',value:20}],
  911. [{name:'北京'}, {name:'常州',value:10}],
  912. [{name:'北京'}, {name:'北京',value:120}]
  913. ];
  914. var planePath = 'path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z';
  915. var convertData = function (data) {
  916. var res = [];
  917. for (var i = 0; i < data.length; i++) {
  918. var dataItem = data[i];
  919. var fromCoord = geoCoordMap[dataItem[0].name];
  920. var toCoord = geoCoordMap[dataItem[1].name];
  921. if (fromCoord && toCoord) {
  922. res.push([{
  923. coord: toCoord
  924. }, {
  925. coord: fromCoord
  926. }]);
  927. }
  928. }
  929. return res;
  930. };
  931. var color = ['#a6c84c', '#00eaff', '#ffde00'];
  932. var series = [];
  933. [['北京', BJData]].forEach(function (item, i) {
  934. series.push({
  935. name: item[0] + ' ',
  936. type: 'lines',
  937. zlevel: 1,
  938. effect: {//波纹点样式
  939. show: true,
  940. period: 6,
  941. trailLength: 0.7,
  942. color: '#fff',
  943. symbolSize: 5
  944. },
  945. lineStyle: {
  946. normal: {
  947. color: color[i],
  948. width: 0,
  949. curveness: 0.2
  950. }
  951. },
  952. data: convertData(item[1])
  953. },
  954. {
  955. name: item[0] + ' ',
  956. type: 'lines',
  957. zlevel: 2,
  958. effect: {
  959. show: true,
  960. period: 6,
  961. trailLength: 0,
  962. symbol: planePath,
  963. symbolSize: 15
  964. },
  965. lineStyle: {
  966. normal: {
  967. color: color[i],
  968. width: 1,
  969. opacity: 0.4,
  970. curveness: 0.2
  971. }
  972. },
  973. data: convertData(item[1])
  974. },
  975. {
  976. name: item[0] + ' ',
  977. type: 'effectScatter',
  978. coordinateSystem: 'geo',
  979. zlevel: 2,
  980. rippleEffect: {
  981. brushType: 'stroke'
  982. },
  983. label: {
  984. normal: {
  985. show: true,
  986. position: 'right',
  987. formatter: '{b}'
  988. }
  989. },
  990. symbolSize: function (val) {
  991. return val[2] / 8;
  992. },
  993. itemStyle: {
  994. normal: {
  995. color: color[i]
  996. }
  997. },
  998. data: item[1].map(function (dataItem) {
  999. return {
  1000. name: dataItem[1].name,
  1001. value: geoCoordMap[dataItem[1].name].concat([dataItem[1].value])
  1002. };
  1003. })
  1004. });
  1005. });
  1006. var option = {
  1007. tooltip : {
  1008. trigger: 'item'
  1009. },
  1010. geo: {
  1011. map: 'china',
  1012. zoom:1.9,
  1013. label: {
  1014. emphasis: {
  1015. show: true,
  1016. color:'#fff'
  1017. }
  1018. },
  1019. roam: true,
  1020. itemStyle: {
  1021. normal: {
  1022. borderWidth: 1,
  1023. areaColor:'rgba(7,16,44, 0.7)',
  1024. borderColor: 'rgba(147, 235, 248, 1)'
  1025. },
  1026. emphasis: {
  1027. areaColor: '#1d83e1'
  1028. }
  1029. }
  1030. },
  1031. series: series
  1032. };
  1033. myChart7 = echarts.init(document.getElementById('moveMapChart'));
  1034. myChart7.setOption(option,true);
  1035. $(document).ready(function(){
  1036.   myChart7.resize();
  1037. })
  1038. window.addEventListener("resize", function () {
  1039.   myChart7.resize();
  1040. });
  1041. }
  1042. /**
  1043. *LED液晶屏数字字符效果
  1044. */
  1045. function showLEDNumber(value,id){
  1046. var htmlArr = [];
  1047. var len = value.length;
  1048. for(var i=0;i<len;i++){
  1049. var number = value.charAt(i);
  1050. htmlArr.push('<div class="clock c'+number+'" >');
  1051. htmlArr.push('<div class="v n1"><div class="u"></div><div class="d"></div></div>');
  1052. htmlArr.push('<div class="v n2"><div class="u"></div><div class="d"></div></div>');
  1053. htmlArr.push('<div class="h n3"><div class="l"></div><div class="r"></div></div>');
  1054. htmlArr.push('<div class="v n4"><div class="u"></div><div class="d"></div></div>');
  1055. htmlArr.push('<div class="v n5"><div class="u"></div><div class="d"></div></div>');
  1056. htmlArr.push('<div class="h n6"><div class="l"></div><div class="r"></div></div>');
  1057. htmlArr.push('<div class="h n7"><div class="l"></div><div class="r"></div></div>');
  1058. htmlArr.push('</div>');
  1059. }
  1060. $("#"+id).html(htmlArr.join(""));
  1061. }
  1062. function clocknum(num,id) {
  1063. $('#'+id).empty();
  1064. var html = '';
  1065. var strarr = num.toString().split('');
  1066. var digit_to_name = 'zero one two three four five six seven eight nine'.split(' ');
  1067. for(var i=0; i<strarr.length; i++){
  1068. if(strarr[i] == '.'){
  1069. html += '<div class="dot"></div>'
  1070. } else {
  1071. var clasname = digit_to_name[strarr[i]];
  1072. html += '<div class="'+clasname+'">' +
  1073. '<span class="d1"></span>' +
  1074. '<span class="d2"></span>' +
  1075. '<span class="d3"></span>' +
  1076. '<span class="d4"></span>' +
  1077. '<span class="d5"></span>' +
  1078. '<span class="d6"></span>' +
  1079. '<span class="d7"></span>' +
  1080. '</div>';
  1081. }
  1082. }
  1083. $('#'+id).append(html);
  1084. }