js.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965
  1. 
  2. $(function () {
  3. echarts_1()
  4. echarts_2()
  5. echarts_3()
  6. echarts_4()
  7. echarts_5()
  8. echarts_map()
  9. echarts_map2()
  10. function echarts_1() {
  11. // 基于准备好的dom,初始化echarts实例
  12. var myChart = echarts.init(document.getElementById('echart1'));
  13. var data = [683, 234, 234, 523, 345, 320, 280, 271, 254, 229, 210, 190, 182]
  14. var titlename = ['有机物污染', '机物污染', '重金属污染', '固体废物污染', '汽车尾气污染', '工业废水污染', '生活垃圾', '农药化肥污染', '微生物污染', '噪音污染', '辐射污染', '氧化物污染', '硫氧化物污染'];
  15. option = {
  16. grid: {
  17. left: '10',
  18. top:'15',
  19. right: '10',
  20. bottom: '0%',
  21. containLabel: true
  22. },
  23. xAxis: {
  24. show: false
  25. },
  26. yAxis: [{
  27. show: true,
  28. data: titlename,
  29. inverse: true,
  30. axisLine: { show: false},
  31. splitLine:{ show: false},
  32. axisTick:{ show: false},
  33. axisLabel: {
  34. textStyle: {
  35. color:'#fff'
  36. },
  37. },
  38. }, {
  39. show: false,
  40. inverse: true,
  41. data: data,
  42. axisLabel: {textStyle: {color: '#fff'}},
  43. axisLine: { show: false},
  44. splitLine:{ show: false},
  45. axisTick: { show: false},
  46. }],
  47. series: [{
  48. name: '条',
  49. type: 'bar',
  50. yAxisIndex: 0,
  51. data: data,
  52. barWidth: 15,
  53. itemStyle: {
  54. normal: {
  55. color:'#1089E7',
  56. }
  57. },
  58. label: {
  59. normal: {
  60. show: true,
  61. position: 'right',
  62. formatter: '{c}',
  63. textStyle: {color: 'rgba(255,255,255,.5)'}
  64. }
  65. },
  66. }]
  67. };
  68. // 使用刚指定的配置项和数据显示图表。
  69. myChart.setOption(option);
  70. window.addEventListener("resize",function(){
  71. myChart.resize();
  72. });
  73. }
  74. function echarts_2() {
  75. // 基于准备好的dom,初始化echarts实例
  76. var myChart = echarts.init(document.getElementById('echart2'));
  77. option = {
  78. "legend": {
  79. "orient": "horizontal",
  80. "y": "bottom",
  81. "x": "center",
  82. "data": ["黑名单查询", "红名单查询", "法人行政处罚", "其它查询"],
  83. "itemWidth": 10,
  84. "itemHeight": 10,
  85. "textStyle": {
  86. "color": "#fff"
  87. },
  88. },
  89. tooltip: {
  90. trigger: 'item',
  91. formatter: "{b} : {c} ({d}%)"
  92. },
  93. visualMap: {
  94. show: false,
  95. min: 500,
  96. max: 600,
  97. inRange: {
  98. //colorLightness: [0, 1]
  99. }
  100. },
  101. series: [{
  102. name: '访问来源',
  103. type: 'pie',
  104. radius: ['20%', '55%'],
  105. center: ['50%', '50%'],
  106. color: ['rgb(131,249,103)', '#FBFE27', '#FE5050', '#1DB7E5'],
  107. data: [{
  108. value: 285,
  109. name: '黑名单查询'
  110. },
  111. {
  112. value: 410,
  113. name: '红名单查询'
  114. },
  115. {
  116. value: 274,
  117. name: '法人行政处罚'
  118. },
  119. {
  120. value: 235,
  121. name: '其它查询'
  122. }
  123. ].sort(function(a, b) {
  124. return a.value - b.value
  125. }),
  126. roseType: 'radius',
  127. label: {
  128. normal: {
  129. formatter: ['{c|{d}%}', '{b|{b}}'].join('\n'),
  130. rich: {
  131. c: {
  132. color: 'rgb(241,246,104)',
  133. fontSize: 20,
  134. fontWeight:'bold',
  135. lineHeight: 5
  136. },
  137. b: {
  138. color: 'rgb(98,137,169)',
  139. fontSize: 15,
  140. height: 40
  141. },
  142. },
  143. }
  144. },
  145. labelLine: {
  146. normal: {
  147. lineStyle: {
  148. color: 'rgb(98,137,169)',
  149. },
  150. smooth: 0.2,
  151. length: 5,
  152. length2: 10,
  153. }
  154. },
  155. itemStyle: {
  156. normal: {
  157. shadowColor: 'rgba(0, 0, 0, 0.8)',
  158. shadowBlur: 50,
  159. }
  160. }
  161. }]
  162. };
  163. myChart.setOption(option);
  164. // 使用刚指定的配置项和数据显示图表。
  165. myChart.setOption(option);
  166. window.addEventListener("resize",function(){
  167. myChart.resize();
  168. });
  169. }
  170. function echarts_3() {
  171. // 基于准备好的dom,初始化echarts实例
  172. var myChart = echarts.init(document.getElementById('echart3'));
  173. var name_flag = 0;
  174. var data = [{
  175. "value": "1046",
  176. "name": "增值税",
  177. },
  178. {
  179. "value": "903",
  180. "name": "资源税",
  181. },
  182. {
  183. "value": "784",
  184. "name": "个人所得税",
  185. },
  186. {
  187. "value": "683",
  188. "name": "城建税",
  189. },
  190. {
  191. "value": "659",
  192. "name": "教育费附加",
  193. },
  194. {
  195. "value": 1488,
  196. "name": "地方教育费附加",
  197. }
  198. ];
  199. var option = {
  200. "legend": {
  201. "orient": "horizontal",
  202. "y": "bottom",
  203. "x": "center",
  204. "data": ["增值税", "资源税", "个人所得税", "城建税", "教育费附加", "地方教育费附加"],
  205. "itemWidth": 10,
  206. "itemHeight": 10,
  207. "textStyle": {
  208. "color": "#fff"
  209. },
  210. },
  211. "title": [{
  212. "show": true,
  213. "text": "",
  214. "textStyle": {
  215. "color": "white",
  216. "fontSize": 14,
  217. "fontStyle": "normal",
  218. },
  219. "top": "44%",
  220. "left": "center"
  221. },
  222. {
  223. "show": true,
  224. "text": "",
  225. "textStyle": {
  226. "color": "white",
  227. "fontSize": 20,
  228. "fontStyle": "normal",
  229. "fontWeight": "bold"
  230. },
  231. "top": "50%",
  232. "left": "center"
  233. },
  234. ],
  235. tooltip: {
  236. trigger: 'item',
  237. formatter: "{b} <br/>数量:{c} ({d}%)",
  238. textStyle: {
  239. // fontSize: 36,
  240. fontWeight: 'bold',
  241. color: 'white',
  242. },
  243. },
  244. //自己设置扇形图颜色
  245. series: [{
  246. name: '税种明细',
  247. type: 'pie',
  248. //位置
  249. center: ['50%', '50%'],
  250. radius: ['30%', '50%'],
  251. avoidLabelOverlap: false,
  252. selectedOffset: 25,
  253. hoverAnimation: false,
  254. itemStyle: {
  255. normal: {
  256. shadowColor: 'rgba(0, 0, 0, 0.5)',
  257. shadowBlur: 10,
  258. }
  259. },
  260. labelLine: {
  261. length: 7,
  262. length2: 30,
  263. lineStyle: {
  264. width:1
  265. }
  266. },
  267. label: {
  268. fontSize: '16',
  269. color: 'white'
  270. },
  271. data: data
  272. },
  273. {
  274. name: '税种明细',
  275. type: 'pie',
  276. radius: '30%',
  277. z: 1,
  278. itemStyle: {
  279. normal: {
  280. label: {
  281. show: false
  282. },
  283. labelLine: {
  284. show: false
  285. }
  286. },
  287. emphasis: {
  288. label: {
  289. show: false,
  290. position: 'center',
  291. textStyle: {
  292. fontSize: '30',
  293. fontWeight: 'bold'
  294. }
  295. }
  296. }
  297. },
  298. color: ['rgba(0,0,0,0)'],
  299. data: [{
  300. value: 100,
  301. tooltip: {
  302. show: false
  303. }
  304. }, ]
  305. }
  306. ]
  307. };
  308. var timeTicket = null;
  309. timeTicket = setInterval(() => {
  310. if (name_flag > 5) {
  311. myChart.dispatchAction({
  312. type: 'pieUnSelect',
  313. seriesIndex: 0,
  314. dataIndex: 5
  315. });
  316. name_flag = 0;
  317. }
  318. myChart.dispatchAction({
  319. type: 'pieSelect',
  320. seriesIndex: 0,
  321. dataIndex: name_flag
  322. });
  323. if (name_flag !== 0) {
  324. myChart.dispatchAction({
  325. type: 'pieUnSelect',
  326. seriesIndex: 0,
  327. dataIndex: name_flag - 1
  328. });
  329. }
  330. option.title[0].text = option.series[0].data[name_flag].name;
  331. option.title[1].text = option.series[0].data[name_flag].value;
  332. myChart.setOption(option);
  333. name_flag++;
  334. }, 2000);
  335. myChart.setOption(option);
  336. // 使用刚指定的配置项和数据显示图表。
  337. myChart.setOption(option);
  338. window.addEventListener("resize",function(){
  339. myChart.resize();
  340. });
  341. }
  342. function echarts_4() {
  343. // 基于准备好的dom,初始化echarts实例
  344. var myChart = echarts.init(document.getElementById('echart4'));
  345. option = {
  346. tooltip: {
  347. trigger: 'axis',
  348. axisPointer: {
  349. lineStyle: {
  350. color: '#57617B'
  351. }
  352. }
  353. },
  354. "legend": {
  355. "data": [
  356. {"name": "税收"},
  357. {"name": "折线"},
  358. ],
  359. "top": "0%",
  360. "textStyle": {
  361. "color": "rgba(255,255,255,0.9)"//图例文字
  362. }
  363. },
  364. "xAxis": [
  365. {
  366. "type": "category",
  367. data: ['1月', '2月', '3月', '4月', '5月', '6月'],
  368. axisLine: { lineStyle: {color: "rgba(255,255,255,.1)"}},
  369. axisLabel: { textStyle: {color: "rgba(255,255,255,.6)", fontSize: '14', },
  370. },
  371. },
  372. ],
  373. "yAxis": [
  374. {
  375. "type": "value",
  376. "name": "单位1",
  377. "min": 0,
  378. "max": 50,
  379. "interval": 10,
  380. "axisLabel": {
  381. "show": true,
  382. },
  383. axisLine: {lineStyle: {color: 'rgba(255,255,255,.2)'}},//左线色
  384. },
  385. {
  386. "type": "value",
  387. "name": "单位2",
  388. "show": true,
  389. "axisLabel": {
  390. "show": true,
  391. },
  392. axisLine: {lineStyle: {color: 'rgba(255,255,255,.2)'}},//右线色
  393. splitLine: {show:true,lineStyle: {color:"#001e94"}},//x轴线
  394. },
  395. ],
  396. "grid": {
  397. "top": "10%",
  398. "right":"30",
  399. "bottom":"30",
  400. "left":"30",
  401. },
  402. "series": [
  403. {
  404. "name": "税收",
  405. "type": "bar",
  406. "data": [4,2,34,6,8,6],
  407. "barWidth": "auto",
  408. "itemStyle": {
  409. "normal": {
  410. "color": {
  411. "type": "linear",
  412. "x": 0,
  413. "y": 0,
  414. "x2": 0,
  415. "y2": 1,
  416. "colorStops": [
  417. {
  418. "offset": 0,
  419. "color": "#66b8a7"
  420. },
  421. {
  422. "offset": 1,
  423. "color": "#66b8a7"
  424. }
  425. ],
  426. "globalCoord": false
  427. }
  428. }
  429. },
  430. "barGap": "0"
  431. },
  432. {
  433. "name": "折线",
  434. "type": "line",
  435. "yAxisIndex": 1,
  436. "data": [100,50,80,30,90,40],
  437. lineStyle: {
  438. normal: {
  439. width: 2
  440. },
  441. },
  442. "itemStyle": {
  443. "normal": {
  444. "color": "#cdba00",
  445. }
  446. },
  447. "smooth": true
  448. }
  449. ]
  450. };
  451. // 使用刚指定的配置项和数据显示图表。
  452. myChart.setOption(option);
  453. window.addEventListener("resize",function(){
  454. myChart.resize();
  455. });
  456. }
  457. function echarts_5() {
  458. // 基于准备好的dom,初始化echarts实例
  459. var myChart = echarts.init(document.getElementById('echart5'));
  460. option = {
  461. "legend": {
  462. "orient": "horizontal",
  463. "y": "bottom",
  464. "x": "center",
  465. "data": ["设备", "建材", "食品"],
  466. "itemWidth": 10,
  467. "itemHeight": 10,
  468. "textStyle": {
  469. "color": "#fff"
  470. },
  471. },
  472. tooltip: {
  473. trigger: 'item',
  474. formatter: "{b} : {c} ({d}%)"
  475. },
  476. visualMap: {
  477. show: false,
  478. min: 500,
  479. max: 600,
  480. inRange: {
  481. //colorLightness: [0, 1]
  482. }
  483. },
  484. series: [{
  485. name: '访问来源',
  486. type: 'pie',
  487. radius: ['20%', '60%'],
  488. center: ['50%', '50%'],
  489. color: ['rgb(131,249,103)', '#FBFE27', '#FE5050', '#1DB7E5'],
  490. data: [{
  491. value: 285,
  492. name: '设备'
  493. },
  494. {
  495. value: 410,
  496. name: '建材'
  497. },
  498. {
  499. value: 274,
  500. name: '食品'
  501. }
  502. ].sort(function(a, b) {
  503. return a.value - b.value
  504. }),
  505. roseType: 'radius',
  506. label: {
  507. normal: {
  508. formatter: ['{c|{d}%}', '{b|{b}}'].join('\n'),
  509. rich: {
  510. c: {
  511. color: 'rgb(241,246,104)',
  512. fontSize: 20,
  513. fontWeight:'bold',
  514. lineHeight: 5
  515. },
  516. b: {
  517. color: 'rgb(98,137,169)',
  518. fontSize: 15,
  519. height: 40
  520. },
  521. },
  522. }
  523. },
  524. labelLine: {
  525. normal: {
  526. lineStyle: {
  527. color: 'rgb(98,137,169)',
  528. },
  529. smooth: 0.2,
  530. length: 10,
  531. length2: 20,
  532. }
  533. },
  534. itemStyle: {
  535. normal: {
  536. shadowColor: 'rgba(0, 0, 0, 0.8)',
  537. shadowBlur: 50,
  538. }
  539. }
  540. }]
  541. };
  542. myChart.setOption(option);
  543. // 使用刚指定的配置项和数据显示图表。
  544. myChart.setOption(option);
  545. window.addEventListener("resize",function(){
  546. myChart.resize();
  547. });
  548. }
  549. function echarts_map() {
  550. var myChart = echarts.init(document.getElementById('map'));
  551. var uploadedDataURL = "js/chenxi.json";
  552. myChart.showLoading();
  553. $.getJSON(uploadedDataURL, function(geoJson) {
  554. echarts.registerMap('chenxi', geoJson);
  555. myChart.hideLoading();
  556. var geoCoordMap = {
  557. '岑城': [111.003903,22.922207]
  558. ,'糯垌':[103.803298,25.496407]
  559. ,'诚谏':[111.245935,23.020671]
  560. ,'归义':[111.096911,22.906905]
  561. ,'筋竹':[111.29382,22.904241]
  562. ,'大业':[111.203045,22.907082]
  563. ,'梨木':[111.12996,22.80186]
  564. ,'大隆':[111.011196,22.767551]
  565. ,'南渡':[110.83674,22.854247]
  566. ,'马路':[110.909045,22.893586]
  567. ,'三堡':[110.929096,23.109585]
  568. ,'波塘':[110.861756,23.017674]
  569. ,'安平':[111.097183,23.113398]
  570. ,'水汶':[110.994962,22.685379]
  571. }
  572. var data1 = [{
  573. name: '糯垌',
  574. value: 80
  575. },{
  576. name: '梨木',
  577. value: 70
  578. }, {
  579. name: '南渡',
  580. value: 75
  581. }, {
  582. name: '水汶',
  583. value: 80
  584. }
  585. ];
  586. var data2 = [{
  587. name: '大隆',
  588. value: 80
  589. },{
  590. name: '筋竹',
  591. value: 180
  592. }
  593. ];
  594. var data3 = [{
  595. name: '安平',
  596. value: 80
  597. },{
  598. name: '波塘',
  599. value: 70
  600. }, {
  601. name: '马路',
  602. value: 75
  603. }, {
  604. name: '大业',
  605. value: 80
  606. }
  607. ];
  608. var convertData = function(data) {
  609. var res = [];
  610. for (var i = 0; i < data.length; i++) {
  611. var geoCoord = geoCoordMap[data[i].name];
  612. if (geoCoord) {
  613. res.push({
  614. name: data[i].name,
  615. value: geoCoord.concat(data[i].value)
  616. });
  617. }
  618. }
  619. return res;
  620. };
  621. option = {
  622. tooltip: {
  623. formatter : function(e){
  624. if (typeof(e.value)[2] == "undefined") {
  625. return e.name;
  626. }else{
  627. return e.name + ':' + e.value[2] + '家';
  628. }
  629. }
  630. },
  631. legend: {
  632. orient: 'vertical',
  633. top: '50',
  634. right: '50',
  635. data: ['开采企业','管理站','加工企业'],
  636. textStyle: {
  637. color: '#fff',
  638. fontSize:18,
  639. }
  640. },
  641. geo: {
  642. map: 'chenxi',
  643. zoom: 1,
  644. itemStyle: {
  645. normal: {
  646. areaColor: 'rgba(0,97,225,.3)',
  647. borderColor: 'rgba(255,255,255,.6)'
  648. },
  649. emphasis: {
  650. areaColor: 'rgba(0,97,225,.5)',
  651. }
  652. }
  653. },
  654. series: [
  655. {
  656. name: '开采企业',
  657. type: 'scatter',
  658. data: data1,
  659. coordinateSystem: 'geo',
  660. data: convertData(data1),
  661. symbolSize: function(val) {
  662. return val[2] / 5;
  663. },
  664. label: {
  665. normal: {
  666. formatter: '{b}',
  667. position: 'bottom',
  668. color: '#fff',
  669. show: true
  670. }
  671. },
  672. itemStyle: {
  673. normal: {
  674. color: '#ffe400',
  675. }
  676. },
  677. zlevel: 1
  678. },
  679. {
  680. name: '管理站',
  681. type: 'scatter',
  682. data: data2,
  683. coordinateSystem: 'geo',
  684. data: convertData(data2),
  685. symbolSize: function(val) {
  686. return val[2] / 5;
  687. },
  688. label: {
  689. normal: {
  690. formatter: '{b}',
  691. position: 'bottom',
  692. color: '#fff',
  693. show: true
  694. }
  695. },
  696. itemStyle: {
  697. normal: {
  698. color: '#07e5ff',
  699. }
  700. },
  701. zlevel: 1
  702. },{
  703. name: '加工企业',
  704. type: 'scatter',
  705. data: data3,
  706. coordinateSystem: 'geo',
  707. data: convertData(data3),
  708. symbolSize: function(val) {
  709. return val[2] / 5;
  710. },
  711. label: {
  712. normal: {
  713. formatter: '{b}',
  714. position: 'bottom',
  715. color: '#fff',
  716. show: true
  717. }
  718. },
  719. itemStyle: {
  720. normal: {
  721. color: '#ff6316',
  722. }
  723. },
  724. zlevel: 1
  725. },
  726. {
  727. type: 'map',
  728. roam: false, //是否开启鼠标缩放和平移漫游
  729. }]
  730. };
  731. myChart.setOption(option);
  732. });
  733. }
  734. function echarts_map2() {
  735. var myChart = echarts.init(document.getElementById('guangxi'));
  736. var uploadedDataURL = "js/45.json";
  737. myChart.showLoading();
  738. $.getJSON(uploadedDataURL, function(geoJson) {
  739. echarts.registerMap('guangxi', geoJson);
  740. myChart.hideLoading();
  741. var geoCoordMap = {
  742. '岑溪': [111.003154,22.925685],
  743. '藤县': [110.989913,23.350225],
  744. '合浦': [109.214017,21.66593],
  745. '田阳': [106.920265,23.740418],
  746. '兴业': [109.883847,22.743869],
  747. '平桂': [111.502419,24.448841],
  748. '覃塘': [109.464024,23.127934]
  749. }
  750. var data1 = [{
  751. name: '藤县',
  752. value: 70
  753. }, {
  754. name: '合浦',
  755. value: 70
  756. }, {
  757. name: '田阳',
  758. value: 70
  759. }, {
  760. name: '平桂',
  761. value: 70
  762. } , {
  763. name: '覃塘',
  764. value: 70
  765. }
  766. ];
  767. var data2 = [{
  768. name: '岑溪',
  769. value: 100
  770. },
  771. ];
  772. var convertData = function(data) {
  773. var res = [];
  774. for (var i = 0; i < data.length; i++) {
  775. var geoCoord = geoCoordMap[data[i].name];
  776. if (geoCoord) {
  777. res.push({
  778. name: data[i].name,
  779. value: geoCoord.concat(data[i].value)
  780. });
  781. }
  782. }
  783. return res;
  784. };
  785. option = {
  786. /**
  787. tooltip: {
  788. formatter : function(e){
  789. if (typeof(e.value)[2] == "undefined") {
  790. return e.name;
  791. }else{
  792. return e.name + ':' + e.value[2] + '家';
  793. }
  794. }
  795. },
  796. **/
  797. legend: {
  798. orient: 'vertical',
  799. top: '50',
  800. right: '50',
  801. data: ['开采企业','管理站'],
  802. textStyle: {
  803. color: '#fff',
  804. fontSize:18,
  805. }
  806. },
  807. geo: {
  808. map: 'guangxi',
  809. zoom: 1,
  810. itemStyle: {
  811. normal: {
  812. areaColor: 'rgba(0,97,225,.3)',
  813. borderColor: 'rgba(255,255,255,.6)'
  814. },
  815. emphasis: {
  816. areaColor: 'rgba(0,97,225,.5)',
  817. }
  818. }
  819. },
  820. series: [
  821. {
  822. name: '开采企业',
  823. type: 'scatter',
  824. data: data1,
  825. coordinateSystem: 'geo',
  826. data: convertData(data1),
  827. symbolSize: function(val) {
  828. return val[2] / 5;
  829. },
  830. label: {
  831. normal: {
  832. formatter: '{b}',
  833. position: 'bottom',
  834. color: '#fff',
  835. show: true
  836. }
  837. },
  838. itemStyle: {
  839. normal: {
  840. color: '#ffe400',
  841. }
  842. },
  843. zlevel: 1
  844. },
  845. {
  846. name: '管理站',
  847. type: 'scatter',
  848. data: data2,
  849. coordinateSystem: 'geo',
  850. data: convertData(data2),
  851. symbolSize: function(val) {
  852. return val[2] / 5;
  853. },
  854. label: {
  855. normal: {
  856. formatter: '{b}',
  857. position: 'bottom',
  858. color: '#fff',
  859. show: true
  860. }
  861. },
  862. itemStyle: {
  863. normal: {
  864. color: '#ff3300',
  865. }
  866. },
  867. zlevel: 1
  868. },
  869. {
  870. type: 'map',
  871. roam: false, //是否开启鼠标缩放和平移漫游
  872. }]
  873. };
  874. myChart.setOption(option);
  875. });
  876. }
  877. })