js.js 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193
  1.  $(window).load(function(){$(".loading").fadeOut()})
  2. $(function () {
  3. echarts_1();
  4. echarts_2();
  5. echarts_3();
  6. echarts_4();
  7. echarts_5();
  8. echarts_6();
  9. echarts_7();
  10. echarts_8();
  11. echarts_9();
  12. echarts_15();
  13. function echarts_1() {
  14. // 基于准备好的dom,初始化echarts实例
  15. var myChart = echarts.init(document.getElementById('echart1'));
  16. var data = [{
  17. title: '**省'
  18. },
  19. ['本周'],
  20. [{
  21. name: '文本1',
  22. max: 150
  23. }, {
  24. name: '文本2',
  25. max: 150
  26. }, {
  27. name: '文本3',
  28. max: 150
  29. }, {
  30. name: '文本4',
  31. max: 150
  32. }, {
  33. name: '文本5',
  34. max: 150
  35. }],
  36. [43, 100, 28, 3, 150],
  37. ]
  38. option = {
  39. color: ['#9DD060', '#35C96E', '#4DCEF8'],
  40. tooltip: {},
  41. radar: {
  42. center: ['50%', '50%'],
  43. radius: ["25%", "70%"],
  44. name: {
  45. textStyle: {
  46. color: '#72ACD1'
  47. }
  48. },
  49. splitLine: {
  50. lineStyle: {
  51. color: 'rgba(255,255,255,.0',
  52. width: 2
  53. }
  54. },
  55. axisLine: {
  56. lineStyle: {
  57. color: 'rgba(255,255,255,0.2)',
  58. width: 1,
  59. type: 'dotted'
  60. },
  61. },
  62. splitArea: {
  63. areaStyle: {
  64. color: ['rgba(255,255,255,.1)', 'rgba(255,255,255,0)']
  65. }
  66. },
  67. indicator: data[2]
  68. },
  69. series: [{
  70. name: '',
  71. type: 'radar',
  72. data: [{
  73. areaStyle: {
  74. normal: {
  75. opacity: 0.3,
  76. }
  77. },
  78. value: data[3],
  79. name: data[1][0]
  80. },
  81. {
  82. areaStyle: {
  83. normal: {
  84. opacity: 0.3,
  85. }
  86. },
  87. value: data[4],
  88. name: data[1][1]
  89. },
  90. {
  91. areaStyle: {
  92. normal: {
  93. opacity: 0.3,
  94. }
  95. },
  96. value: data[5],
  97. name: data[1][2]
  98. }
  99. ]
  100. }]
  101. };
  102. // 使用刚指定的配置项和数据显示图表。
  103. myChart.setOption(option);
  104. window.addEventListener("resize",function(){
  105. myChart.resize();
  106. });
  107. }
  108. function echarts_2() {
  109. // 基于准备好的dom,初始化echarts实例
  110. var myChart = echarts.init(document.getElementById('echart2'));
  111. option = {
  112. // backgroundColor: '#00265f',
  113. tooltip: {
  114. trigger: 'axis',
  115. axisPointer: {
  116. type: 'shadow'
  117. }
  118. },
  119. legend: {
  120. data: ['2017年', '2018年'],
  121. top:'5%',
  122. textStyle: {
  123. color: "#fff",
  124. fontSize: '12',
  125. },
  126. itemGap: 35
  127. },
  128. grid: {
  129. left: '0%',
  130. top:'40px',
  131. right: '0%',
  132. bottom: '0',
  133. containLabel: true
  134. },
  135. xAxis: [{
  136. type: 'category',
  137. data: ['1月', '2月', '3月', '4月', '5月', '6月'],
  138. axisLine: {
  139. show: true,
  140. lineStyle: {
  141. color: "rgba(255,255,255,.1)",
  142. width: 1,
  143. type: "solid"
  144. },
  145. },
  146. axisTick: {
  147. show: false,
  148. },
  149. axisLabel: {
  150. interval: 0,
  151. // rotate:50,
  152. show: true,
  153. splitNumber: 5,
  154. textStyle: {
  155. color: "rgba(255,255,255,.6)",
  156. fontSize: '12',
  157. },
  158. },
  159. }],
  160. yAxis: [{
  161. type: 'value',
  162. axisLabel: {
  163. //formatter: '{value} %'
  164. show:true,
  165. textStyle: {
  166. color: "rgba(255,255,255,.6)",
  167. fontSize: '12',
  168. },
  169. },
  170. axisTick: {
  171. show: false,
  172. },
  173. axisLine: {
  174. show: true,
  175. lineStyle: {
  176. color: "rgba(255,255,255,.1 )",
  177. width: 1,
  178. type: "solid"
  179. },
  180. },
  181. splitLine: {
  182. lineStyle: {
  183. color: "rgba(255,255,255,.1)",
  184. }
  185. }
  186. }],
  187. series: [{
  188. name: '2017年',
  189. type: 'line',
  190. smooth: true,
  191. data: [2, 6, 3, 8, 5, 8],
  192. itemStyle: {
  193. normal: {
  194. color:'#2f89cf',
  195. opacity: 1,
  196. barBorderRadius: 5,
  197. }
  198. }
  199. }, {
  200. name: '2018年',
  201. type: 'line',
  202. smooth: true,
  203. data: [5, 2, 6, 4, 5, 12],
  204. barWidth:'15',
  205. // barGap: 1,
  206. itemStyle: {
  207. normal: {
  208. color:'#62c98d',
  209. opacity: 1,
  210. barBorderRadius: 5,
  211. }
  212. }
  213. },
  214. ]
  215. };
  216. // 使用刚指定的配置项和数据显示图表。
  217. myChart.setOption(option);
  218. window.addEventListener("resize",function(){
  219. myChart.resize();
  220. });
  221. }
  222. function echarts_3() {
  223. // 基于准备好的dom,初始化echarts实例
  224. var myChart = echarts.init(document.getElementById('echart3'));
  225. option = {
  226. // backgroundColor: '#00265f',
  227. tooltip: {
  228. trigger: 'axis',
  229. axisPointer: {
  230. type: 'shadow'
  231. }
  232. },
  233. legend: {
  234. data: ['2017年', '2018年'],
  235. top:'5%',
  236. textStyle: {
  237. color: "#fff",
  238. fontSize: '12',
  239. },
  240. itemGap: 35
  241. },
  242. grid: {
  243. left: '0%',
  244. top:'40px',
  245. right: '0%',
  246. bottom: '0',
  247. containLabel: true
  248. },
  249. xAxis: [{
  250. type: 'category',
  251. data: ['1月', '2月', '3月', '4月', '5月', '6月'],
  252. axisLine: {
  253. show: true,
  254. lineStyle: {
  255. color: "rgba(255,255,255,.1)",
  256. width: 1,
  257. type: "solid"
  258. },
  259. },
  260. axisTick: {
  261. show: false,
  262. },
  263. axisLabel: {
  264. interval: 0,
  265. // rotate:50,
  266. show: true,
  267. splitNumber: 15,
  268. textStyle: {
  269. color: "rgba(255,255,255,.6)",
  270. fontSize: '12',
  271. },
  272. },
  273. }],
  274. yAxis: [{
  275. type: 'value',
  276. axisLabel: {
  277. //formatter: '{value} %'
  278. show:true,
  279. textStyle: {
  280. color: "rgba(255,255,255,.6)",
  281. fontSize: '12',
  282. },
  283. },
  284. axisTick: {
  285. show: false,
  286. },
  287. axisLine: {
  288. show: true,
  289. lineStyle: {
  290. color: "rgba(255,255,255,.1 )",
  291. width: 1,
  292. type: "solid"
  293. },
  294. },
  295. splitLine: {
  296. lineStyle: {
  297. color: "rgba(255,255,255,.1)",
  298. }
  299. }
  300. }],
  301. series: [{
  302. name: '2017年',
  303. type: 'line',
  304. smooth: true,
  305. data: [8, 16, 10, 12, 7, 9],
  306. itemStyle: {
  307. normal: {
  308. color:'#2f89cf',
  309. opacity: 1,
  310. barBorderRadius: 5,
  311. }
  312. }
  313. }, {
  314. name: '2018年',
  315. type: 'line',
  316. smooth: true,
  317. data: [5, 12, 6, 4, 5, 12],
  318. barWidth:'15',
  319. // barGap: 1,
  320. itemStyle: {
  321. normal: {
  322. color:'#62c98d',
  323. opacity: 1,
  324. barBorderRadius: 5,
  325. }
  326. }
  327. },
  328. ]
  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. var data = [78, 60, 60, 70, 69, 60, 70, 69]
  340. var titlename = ['文本1', '文本2', '文本3', '文本4', '文本5', '文本6', '文本7', '文本8'];
  341. var valdata = [683, 234, 234, 523, 345, 234, 523, 345]
  342. option = {
  343. grid: {
  344. left: '10',
  345. top: '20',
  346. right: '30',
  347. bottom: '-25',
  348. containLabel: true
  349. },
  350. xAxis: {
  351. show: false
  352. },
  353. yAxis: [{
  354. show: true,
  355. data: titlename,
  356. inverse: true,
  357. axisLine: {
  358. show: false
  359. },
  360. splitLine: {
  361. show: false
  362. },
  363. axisTick: {
  364. show: false
  365. },
  366. axisLabel: {
  367. textStyle: {
  368. color: "rgba(255,255,255,.6)",
  369. },
  370. formatter: function(value, index) {
  371. return [
  372. '{title|' + value + '} '
  373. ].join('\n')
  374. },
  375. rich: {}
  376. },
  377. }, {
  378. show: true,
  379. inverse: true,
  380. data: valdata,
  381. axisLabel: {
  382. textStyle: {
  383. color: 'rgba(255,255,255,.5)'
  384. }
  385. },
  386. axisLine: {
  387. show: false
  388. },
  389. splitLine: {
  390. show: false
  391. },
  392. axisTick: {
  393. show: false
  394. },
  395. }],
  396. series: [{
  397. name: '条',
  398. type: 'bar',
  399. yAxisIndex: 0,
  400. data: data,
  401. barWidth: '40%',
  402. itemStyle: {
  403. normal: {
  404. barBorderRadius: 30,
  405. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
  406. offset: 0,
  407. color: '#248ff7'
  408. }, {
  409. offset: 1,
  410. color: '#3893e5'
  411. }]),
  412. }
  413. },
  414. label: {
  415. normal: {
  416. show: false,
  417. }
  418. },
  419. }, {
  420. name: '框',
  421. type: 'bar',
  422. yAxisIndex: 1,
  423. barGap: '-100%',
  424. data: [100, 100, 100, 100, 100, 100, 100, 100],
  425. barWidth: '40%',
  426. itemStyle: {
  427. normal: {
  428. color: 'none',
  429. borderColor: 'rgba(255,255,255,.1)',
  430. borderWidth: 1,
  431. barBorderRadius: 15,
  432. }
  433. }
  434. }]
  435. };
  436. // 使用刚指定的配置项和数据显示图表。
  437. myChart.setOption(option);
  438. window.addEventListener("resize",function(){
  439. myChart.resize();
  440. });
  441. }
  442. function echarts_5() {
  443. var myChart = echarts.init(document.getElementById('echart5'));
  444. let inputValue =80
  445. option = {
  446. title: {
  447. subtext: '文本1',
  448. left: 'center',
  449. bottom:15,
  450. subtextStyle: {
  451. color: 'rgba(255,255,255,.6)',
  452. fontSize: 12
  453. }
  454. },
  455. series: [
  456. {
  457. name: '',
  458. type: 'gauge',
  459. radius: '90%',
  460. startAngle: 200,
  461. endAngle: -20,
  462. detail: {formatter: '{value}'},
  463. data: [{value: inputValue, name: ''}],
  464. axisLine: {
  465. lineStyle: {
  466. width: 10,
  467. color: [
  468. [
  469. 0.8, new echarts.graphic.LinearGradient(//0.8值为颜色显示百分比80%
  470. 0, 0, 1, 0, [{
  471. offset: 0,
  472. color: '#ae3df6'
  473. },
  474. {
  475. offset: 1,
  476. color: '#53bef9'
  477. }
  478. ]
  479. )
  480. ],
  481. [
  482. 1, '#1c4e85'
  483. ]
  484. ]
  485. }
  486. },
  487. pointer: {
  488. show: false, //不显示指针
  489. length: "70%",
  490. width:3,
  491. },
  492. axisLabel: {
  493. show: false
  494. },
  495. axisTick: {
  496. show: false
  497. },
  498. splitLine: {
  499. show: false
  500. },
  501. detail: {
  502. offsetCenter: [0, 1],
  503. color: '#fff',
  504. fontSize: 16,
  505. }
  506. },
  507. ]
  508. }
  509. myChart.setOption(option);
  510. window.addEventListener("resize",function(){
  511. myChart.resize();
  512. });
  513. }
  514. function echarts_6() {
  515. var myChart = echarts.init(document.getElementById('echart6'));
  516. let inputValue = 2
  517. option = {
  518. title: {
  519. subtext: '文本2',
  520. left: 'center',
  521. bottom:15,
  522. subtextStyle: {
  523. color: 'rgba(255,255,255,.6)',
  524. fontSize: 12
  525. }
  526. },
  527. series: [
  528. {
  529. name: '',
  530. type: 'gauge',
  531. radius: '90%',
  532. startAngle: 200,
  533. endAngle: -20,
  534. detail: {formatter: '{value}'},
  535. data: [{value: inputValue, name: ''}],
  536. axisLine: {
  537. lineStyle: {
  538. width: 10,
  539. color: [
  540. [
  541. 0.7, new echarts.graphic.LinearGradient(//0.8值为颜色显示百分比%
  542. 0, 0, 1, 0, [{
  543. offset: 0,
  544. color: '#1db0d2'
  545. },
  546. {
  547. offset: 1,
  548. color: '#44ceef'
  549. }
  550. ]
  551. )
  552. ],
  553. [
  554. 1, '#1c4e85'
  555. ]
  556. ]
  557. }
  558. },
  559. pointer: {
  560. show: false, //不显示指针
  561. length: "70%",
  562. width:3,
  563. },
  564. axisLabel: {
  565. show: false
  566. },
  567. axisTick: {
  568. show: false
  569. },
  570. splitLine: {
  571. show: false
  572. },
  573. detail: {
  574. offsetCenter: [0, 1],
  575. color: '#fff',
  576. fontSize: 16,
  577. }
  578. },
  579. ]
  580. }
  581. myChart.setOption(option);
  582. window.addEventListener("resize",function(){
  583. myChart.resize();
  584. });
  585. }
  586. function echarts_7() {
  587. var myChart = echarts.init(document.getElementById('echart7'));
  588. let inputValue = 10
  589. option = {
  590. title: {
  591. subtext: '文本3',
  592. left: 'center',
  593. bottom:15,
  594. subtextStyle: {
  595. color: 'rgba(255,255,255,.6)',
  596. fontSize: 12
  597. }
  598. },
  599. series: [
  600. {
  601. name: '',
  602. type: 'gauge',
  603. radius: '90%',
  604. startAngle: 200,
  605. endAngle: -20,
  606. detail: {formatter: '{value}'},
  607. data: [{value: inputValue, name: ''}],
  608. axisLine: {
  609. lineStyle: {
  610. width: 10,
  611. color: [
  612. [
  613. 0.2, new echarts.graphic.LinearGradient(//0.8值为颜色显示百分比80%
  614. 0, 0, 1, 0, [{
  615. offset: 0,
  616. color: '#1ea899'
  617. },
  618. {
  619. offset: 1,
  620. color: '#29c582'
  621. }
  622. ]
  623. )
  624. ],
  625. [
  626. 1, '#1c4e85'
  627. ]
  628. ]
  629. }
  630. },
  631. pointer: {
  632. show: false, //不显示指针
  633. length: "70%",
  634. width:3,
  635. },
  636. axisLabel: {
  637. show: false
  638. },
  639. axisTick: {
  640. show: false
  641. },
  642. splitLine: {
  643. show: false
  644. },
  645. detail: {
  646. offsetCenter: [0, 1],
  647. color: '#fff',
  648. fontSize: 16,
  649. }
  650. },
  651. ]
  652. }
  653. myChart.setOption(option);
  654. window.addEventListener("resize",function(){
  655. myChart.resize();
  656. });
  657. }
  658. function echarts_8() {
  659. var myChart = echarts.init(document.getElementById('echart8'));
  660. let inputValue = 2.5
  661. option = {
  662. title: {
  663. subtext: '文本4',
  664. left: 'center',
  665. bottom:15,
  666. subtextStyle: {
  667. color: 'rgba(255,255,255,.6)',
  668. fontSize: 12
  669. }
  670. },
  671. series: [
  672. {
  673. name: '',
  674. type: 'gauge',
  675. radius: '90%',
  676. startAngle: 200,
  677. endAngle: -20,
  678. detail: {formatter: '{value}'},
  679. data: [{value: inputValue, name: ''}],
  680. axisLine: {
  681. lineStyle: {
  682. width: 10,
  683. color: [
  684. [
  685. 0.4, new echarts.graphic.LinearGradient(//0.8值为颜色显示百分比80%
  686. 0, 0, 1, 0, [{
  687. offset: 0,
  688. color: '#e6658f'
  689. },
  690. {
  691. offset: 1,
  692. color: '#f8a58b'
  693. }
  694. ]
  695. )
  696. ],
  697. [
  698. 1, '#1c4e85'
  699. ]
  700. ]
  701. }
  702. },
  703. pointer: {
  704. show: false, //不显示指针
  705. length: "70%",
  706. width:3,
  707. },
  708. axisLabel: {
  709. show: false
  710. },
  711. axisTick: {
  712. show: false
  713. },
  714. splitLine: {
  715. show: false
  716. },
  717. detail: {
  718. offsetCenter: [0, 1],
  719. color: '#fff',
  720. fontSize: 16,
  721. }
  722. },
  723. ]
  724. }
  725. myChart.setOption(option);
  726. window.addEventListener("resize",function(){
  727. myChart.resize();
  728. });
  729. }
  730. function echarts_9() {
  731. var myChart = echarts.init(document.getElementById('echart9'));
  732. option = {
  733. tooltip: {
  734. trigger: 'axis',
  735. axisPointer: {type: 'shadow'},
  736. formatter:'{b}走势' ,
  737. },
  738. legend: {
  739. x: 'center',
  740. y: '10',
  741. icon: 'circle',
  742. itemGap:8,
  743. textStyle: {color: 'rgba(255,255,255,1)'},
  744. itemWidth: 10,
  745. itemHeight: 10,
  746. },
  747. grid: {
  748. left: '0',
  749. top: '40',
  750. right: '15',
  751. bottom: '0',
  752. containLabel: true
  753. },
  754. xAxis: {
  755. type: 'category',
  756. data: ['1月', '2月', '3月', '4月', '5月', '6月'],
  757. axisLine: {show:false},
  758. axisLabel: {
  759. textStyle: {
  760. color:'rgba(255,255,255,.5)',
  761. }
  762. },
  763. },
  764. yAxis: {
  765. type: 'value',
  766. splitNumber:4,
  767. axisLine: { show: false },
  768. axisTick: {show: false},
  769. splitLine: {
  770. show: true,
  771. lineStyle: {
  772. color: 'rgba(255,255,255,0.05)'
  773. }
  774. },
  775. axisLabel: {
  776. textStyle: {
  777. color: "rgba(255,255,255,.5)",
  778. },
  779. },
  780. },
  781. series: [ {
  782. name: '用电',
  783. type: 'bar',
  784. barWidth: '25%',
  785. itemStyle: {
  786. normal: {
  787. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  788. offset: 0,
  789. color: '#8bd46e'
  790. }, {
  791. offset: 1,
  792. color: '#03b48e'
  793. }]),
  794. barBorderRadius: 11,
  795. }
  796. },
  797. data: [123,154, 234, 321,120,390]
  798. },
  799. {
  800. name: '水质',
  801. type: 'bar',
  802. barWidth: '25%',
  803. itemStyle: {
  804. normal: {
  805. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  806. offset: 0,
  807. color: '#3893e5'
  808. }, {
  809. offset: 1,
  810. color: '#248ff7'
  811. }]),
  812. barBorderRadius: 11,
  813. }
  814. },
  815. data: [63,194, 234, 321,278,110]
  816. }
  817. ]
  818. };
  819. myChart.setOption(option);
  820. window.addEventListener("resize",function(){
  821. myChart.resize();
  822. });
  823. }
  824. function echarts_15() {
  825. var myChart = echarts.init(document.getElementById('map'));
  826. var data = [
  827. {name: '衢州', value: 177},
  828. {name: '广州', value: 277},
  829. {name: '廊坊', value: 193},
  830. {name: '菏泽', value: 194},
  831. {name: '合肥', value: 229},
  832. {name: '武汉', value: 273},
  833. {name: '大庆', value: 279},
  834. {name: '北京', value: 379},
  835. {name: '重庆', value: 120}
  836. ];
  837. var geoCoordMap = {
  838. '海门':[121.15,31.89],
  839. '鄂尔多斯':[109.781327,39.608266],
  840. '招远':[120.38,37.35],
  841. '舟山':[122.207216,29.985295],
  842. '齐齐哈尔':[123.97,47.33],
  843. '盐城':[120.13,33.38],
  844. '赤峰':[118.87,42.28],
  845. '青岛':[120.33,36.07],
  846. '乳山':[121.52,36.89],
  847. '金昌':[102.188043,38.520089],
  848. '泉州':[118.58,24.93],
  849. '莱西':[120.53,36.86],
  850. '日照':[119.46,35.42],
  851. '胶南':[119.97,35.88],
  852. '南通':[121.05,32.08],
  853. '拉萨':[91.11,29.97],
  854. '云浮':[112.02,22.93],
  855. '梅州':[116.1,24.55],
  856. '文登':[122.05,37.2],
  857. '上海':[121.48,31.22],
  858. '攀枝花':[101.718637,26.582347],
  859. '威海':[122.1,37.5],
  860. '承德':[117.93,40.97],
  861. '厦门':[118.1,24.46],
  862. '汕尾':[115.375279,22.786211],
  863. '潮州':[116.63,23.68],
  864. '丹东':[124.37,40.13],
  865. '太仓':[121.1,31.45],
  866. '曲靖':[103.79,25.51],
  867. '烟台':[121.39,37.52],
  868. '福州':[119.3,26.08],
  869. '瓦房店':[121.979603,39.627114],
  870. '即墨':[120.45,36.38],
  871. '抚顺':[123.97,41.97],
  872. '玉溪':[102.52,24.35],
  873. '张家口':[114.87,40.82],
  874. '阳泉':[113.57,37.85],
  875. '莱州':[119.942327,37.177017],
  876. '湖州':[120.1,30.86],
  877. '汕头':[116.69,23.39],
  878. '昆山':[120.95,31.39],
  879. '宁波':[121.56,29.86],
  880. '湛江':[110.359377,21.270708],
  881. '揭阳':[116.35,23.55],
  882. '荣成':[122.41,37.16],
  883. '连云港':[119.16,34.59],
  884. '葫芦岛':[120.836932,40.711052],
  885. '常熟':[120.74,31.64],
  886. '东莞':[113.75,23.04],
  887. '河源':[114.68,23.73],
  888. '淮安':[119.15,33.5],
  889. '泰州':[119.9,32.49],
  890. '南宁':[108.33,22.84],
  891. '营口':[122.18,40.65],
  892. '惠州':[114.4,23.09],
  893. '江阴':[120.26,31.91],
  894. '蓬莱':[120.75,37.8],
  895. '韶关':[113.62,24.84],
  896. '嘉峪关':[98.289152,39.77313],
  897. '广州':[113.23,23.16],
  898. '延安':[109.47,36.6],
  899. '太原':[112.53,37.87],
  900. '清远':[113.01,23.7],
  901. '中山':[113.38,22.52],
  902. '昆明':[102.73,25.04],
  903. '寿光':[118.73,36.86],
  904. '盘锦':[122.070714,41.119997],
  905. '长治':[113.08,36.18],
  906. '深圳':[114.07,22.62],
  907. '珠海':[113.52,22.3],
  908. '宿迁':[118.3,33.96],
  909. '咸阳':[108.72,34.36],
  910. '铜川':[109.11,35.09],
  911. '平度':[119.97,36.77],
  912. '佛山':[113.11,23.05],
  913. '海口':[110.35,20.02],
  914. '江门':[113.06,22.61],
  915. '章丘':[117.53,36.72],
  916. '肇庆':[112.44,23.05],
  917. '大连':[121.62,38.92],
  918. '临汾':[111.5,36.08],
  919. '吴江':[120.63,31.16],
  920. '石嘴山':[106.39,39.04],
  921. '沈阳':[123.38,41.8],
  922. '苏州':[120.62,31.32],
  923. '茂名':[110.88,21.68],
  924. '嘉兴':[120.76,30.77],
  925. '长春':[125.35,43.88],
  926. '胶州':[120.03336,36.264622],
  927. '银川':[106.27,38.47],
  928. '张家港':[120.555821,31.875428],
  929. '三门峡':[111.19,34.76],
  930. '锦州':[121.15,41.13],
  931. '南昌':[115.89,28.68],
  932. '柳州':[109.4,24.33],
  933. '三亚':[109.511909,18.252847],
  934. '自贡':[104.778442,29.33903],
  935. '吉林':[126.57,43.87],
  936. '阳江':[111.95,21.85],
  937. '泸州':[105.39,28.91],
  938. '西宁':[101.74,36.56],
  939. '宜宾':[104.56,29.77],
  940. '呼和浩特':[111.65,40.82],
  941. '成都':[104.06,30.67],
  942. '大同':[113.3,40.12],
  943. '镇江':[119.44,32.2],
  944. '桂林':[110.28,25.29],
  945. '张家界':[110.479191,29.117096],
  946. '宜兴':[119.82,31.36],
  947. '北海':[109.12,21.49],
  948. '西安':[108.95,34.27],
  949. '金坛':[119.56,31.74],
  950. '东营':[118.49,37.46],
  951. '牡丹江':[129.58,44.6],
  952. '遵义':[106.9,27.7],
  953. '绍兴':[120.58,30.01],
  954. '扬州':[119.42,32.39],
  955. '常州':[119.95,31.79],
  956. '潍坊':[119.1,36.62],
  957. '重庆':[106.54,29.59],
  958. '台州':[121.420757,28.656386],
  959. '南京':[118.78,32.04],
  960. '滨州':[118.03,37.36],
  961. '贵阳':[106.71,26.57],
  962. '无锡':[120.29,31.59],
  963. '本溪':[123.73,41.3],
  964. '克拉玛依':[84.77,45.59],
  965. '渭南':[109.5,34.52],
  966. '马鞍山':[118.48,31.56],
  967. '宝鸡':[107.15,34.38],
  968. '焦作':[113.21,35.24],
  969. '句容':[119.16,31.95],
  970. '北京':[116.46,39.92],
  971. '徐州':[117.2,34.26],
  972. '衡水':[115.72,37.72],
  973. '包头':[110,40.58],
  974. '绵阳':[104.73,31.48],
  975. '乌鲁木齐':[87.68,43.77],
  976. '枣庄':[117.57,34.86],
  977. '杭州':[120.19,30.26],
  978. '淄博':[118.05,36.78],
  979. '鞍山':[122.85,41.12],
  980. '溧阳':[119.48,31.43],
  981. '库尔勒':[86.06,41.68],
  982. '安阳':[114.35,36.1],
  983. '开封':[114.35,34.79],
  984. '济南':[117,36.65],
  985. '德阳':[104.37,31.13],
  986. '温州':[120.65,28.01],
  987. '九江':[115.97,29.71],
  988. '邯郸':[114.47,36.6],
  989. '临安':[119.72,30.23],
  990. '兰州':[103.73,36.03],
  991. '沧州':[116.83,38.33],
  992. '临沂':[118.35,35.05],
  993. '南充':[106.110698,30.837793],
  994. '天津':[117.2,39.13],
  995. '富阳':[119.95,30.07],
  996. '泰安':[117.13,36.18],
  997. '诸暨':[120.23,29.71],
  998. '郑州':[113.65,34.76],
  999. '哈尔滨':[126.63,45.75],
  1000. '聊城':[115.97,36.45],
  1001. '芜湖':[118.38,31.33],
  1002. '唐山':[118.02,39.63],
  1003. '平顶山':[113.29,33.75],
  1004. '邢台':[114.48,37.05],
  1005. '德州':[116.29,37.45],
  1006. '济宁':[116.59,35.38],
  1007. '荆州':[112.239741,30.335165],
  1008. '宜昌':[111.3,30.7],
  1009. '义乌':[120.06,29.32],
  1010. '丽水':[119.92,28.45],
  1011. '洛阳':[112.44,34.7],
  1012. '秦皇岛':[119.57,39.95],
  1013. '株洲':[113.16,27.83],
  1014. '石家庄':[114.48,38.03],
  1015. '莱芜':[117.67,36.19],
  1016. '常德':[111.69,29.05],
  1017. '保定':[115.48,38.85],
  1018. '湘潭':[112.91,27.87],
  1019. '金华':[119.64,29.12],
  1020. '岳阳':[113.09,29.37],
  1021. '长沙':[113,28.21],
  1022. '衢州':[118.88,28.97],
  1023. '廊坊':[116.7,39.53],
  1024. '菏泽':[115.480656,35.23375],
  1025. '合肥':[117.27,31.86],
  1026. '武汉':[114.31,30.52],
  1027. '大庆':[125.03,46.58]
  1028. };
  1029. var convertData = function (data) {
  1030. var res = [];
  1031. for (var i = 0; i < data.length; i++) {
  1032. var geoCoord = geoCoordMap[data[i].name];
  1033. if (geoCoord) {
  1034. res.push({
  1035. name: data[i].name,
  1036. value: geoCoord.concat(data[i].value)
  1037. });
  1038. }
  1039. }
  1040. return res;
  1041. };
  1042. option = {
  1043. // backgroundColor: '#404a59',
  1044. /*** title: {
  1045. text: '实时行驶车辆',
  1046. subtext: 'data from PM25.in',
  1047. sublink: 'http://www.pm25.in',
  1048. left: 'center',
  1049. textStyle: {
  1050. color: '#fff'
  1051. }
  1052. },**/
  1053. tooltip : {
  1054. trigger: 'item'
  1055. },
  1056. geo: {
  1057. map: 'china',
  1058. zoom: 1.1,//放大
  1059. label: {
  1060. emphasis: {
  1061. show: false
  1062. }
  1063. },
  1064. roam: true,
  1065. itemStyle: {
  1066. normal: {
  1067. areaColor: 'rgba(2,37,101,.5)',
  1068. borderColor: 'rgba(112,187,252,.5)'
  1069. },
  1070. emphasis: {
  1071. areaColor: 'rgba(2,37,101,.8)'
  1072. }
  1073. }
  1074. },
  1075. series : [
  1076. {
  1077. name: '消费金额',
  1078. type: 'effectScatter',
  1079. coordinateSystem: 'geo',
  1080. rippleEffect: {
  1081. brushType: 'stroke'
  1082. },
  1083. data: convertData(data),
  1084. symbolSize: function (val) {
  1085. return val[2] / 15;
  1086. },
  1087. label: {
  1088. normal: {
  1089. formatter: '{b}',
  1090. position: 'right',
  1091. show: false
  1092. },
  1093. emphasis: {
  1094. show: true
  1095. }
  1096. },
  1097. itemStyle: {
  1098. normal: {
  1099. color: '#ffeb7b'
  1100. }
  1101. }
  1102. }
  1103. ]
  1104. };
  1105. myChart.setOption(option);
  1106. window.addEventListener("resize",function(){
  1107. myChart.resize();
  1108. });
  1109. }
  1110. })