index.js 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724
  1. let app = new Vue({
  2. el: '#app',
  3. data () {
  4. return {
  5. leftEcharts1: '',
  6. leftEcharts2: '',
  7. leftEcharts3: '',
  8. leftEcharts4: '',
  9. leftEcharts5: '',
  10. leftEcharts6: '',
  11. leftEcharts7: '',
  12. leftEcharts8: '',
  13. shanxiMap: '',// 山西地图
  14. industryProportion: 1, // 主辅业占比轮播
  15. industryLayout: 0,//产业布局分析
  16. time1: '', // 4秒定时器
  17. time2: '', // 针对投前产业布局分析的定时器
  18. }
  19. },
  20. created () {
  21. },
  22. beforeDestroy () {
  23. },
  24. mounted () {
  25. this.time4s()
  26. this.timeNs()
  27. setTimeout(() => {
  28. this.leftEcharts1Fun()
  29. this.leftEcharts2Fun()
  30. this.leftEcharts3Fun()
  31. this.leftEcharts4Fun()
  32. this.leftEcharts5Fun()
  33. this.leftEcharts6Fun()
  34. this.leftEcharts7Fun()
  35. this.leftEcharts8Fun()
  36. this.chinaEchartsFun()
  37. })
  38. // this.moChart()
  39. },
  40. methods: {
  41. // 4秒定时器
  42. time4s () {
  43. let that = this
  44. // 4秒定时器
  45. this.time1 = setInterval(() => {
  46. that.industryProportion == 1 ? that.industryProportion = 2 : that.industryProportion = 1
  47. that.leftEcharts1.dispose()
  48. that.leftEcharts2.dispose()
  49. that.leftEcharts3.dispose()
  50. that.leftEcharts4.dispose()
  51. that.leftEcharts1Fun()
  52. that.leftEcharts2Fun()
  53. that.leftEcharts3Fun()
  54. that.leftEcharts4Fun()
  55. }, 4000);
  56. },
  57. // 针对投前产业布局分析的定时器
  58. timeNs () {
  59. let that = this
  60. this.time2 = setInterval(() => {
  61. if (that.industryLayout < 3) {
  62. that.industryLayout = that.industryLayout + 1
  63. } else {
  64. that.industryLayout = 0
  65. }
  66. this.time2 && clearInterval(this.time2)
  67. this.timeNs()
  68. that.leftEcharts5.dispose()
  69. that.leftEcharts5Fun()
  70. }, left1[that.industryLayout].length * 2000);
  71. },
  72. // 主辅业占比点击方法
  73. industryProportionChange (e) {
  74. let that = this
  75. this.industryProportion = e
  76. this.time1 && clearInterval(this.time1)
  77. that.leftEcharts1.dispose()
  78. that.leftEcharts2.dispose()
  79. that.leftEcharts3.dispose()
  80. that.leftEcharts4.dispose()
  81. that.leftEcharts1Fun()
  82. that.leftEcharts2Fun()
  83. that.leftEcharts3Fun()
  84. that.leftEcharts4Fun()
  85. this.time4s()
  86. },
  87. // 产业布局分析点击方法
  88. industryLayoutChange (e) {
  89. this.industryLayout = e
  90. },
  91. yuanChange (value) {
  92. return Number((value / 100000000).toFixed(2))
  93. },
  94. // 逢三折断
  95. numFormat (value) {
  96. if (!value) return '0'
  97. // var intPart = Number(value).toFixed(0) // 获取整数部分
  98. var intPart = parseInt(value)// 获取整数部分
  99. var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
  100. var floatPart = '.00' // 预定义小数部分
  101. var value2Array = value.toString().split('.')
  102. // =2表示数据有小数位
  103. if (value2Array.length === 2) {
  104. floatPart = value2Array[1].toString() // 拿到小数部分
  105. if (floatPart.length === 1) {
  106. // 补0
  107. return intPartFormat + '.' + floatPart + '0'
  108. } else {
  109. floatPart = floatPart.slice(0, 2)
  110. return intPartFormat + '.' + floatPart
  111. }
  112. } else {
  113. return intPartFormat
  114. }
  115. },
  116. leftEcharts1Fun () {
  117. let that = this
  118. this.leftEcharts1 = echarts.init(this.$refs['leftEcharts1'])
  119. option = {
  120. title: {
  121. text: that.industryProportion == 1 ? '30%' : '70%',
  122. x: 'center',
  123. y: 'center',
  124. textStyle: {
  125. fontWeight: 'normal',
  126. color: '#68BDFF',
  127. fontSize: '20'
  128. }
  129. },
  130. color: ['#68BDFF', '#254F7F'],
  131. series: [{
  132. name: 'Line 1',
  133. type: 'pie',
  134. clockWise: true,
  135. radius: ['80%', '100%'],
  136. itemStyle: {
  137. normal: {
  138. label: {
  139. show: false
  140. },
  141. labelLine: {
  142. show: false
  143. }
  144. }
  145. },
  146. hoverAnimation: false,
  147. data: [{
  148. value: 80,
  149. name: '01',
  150. itemStyle: {
  151. normal: {
  152. label: {
  153. show: false
  154. },
  155. labelLine: {
  156. show: false
  157. }
  158. }
  159. }
  160. }, {
  161. name: '02',
  162. value: 20
  163. }]
  164. }]
  165. }
  166. //轮播
  167. // tools.loopShowTooltip(leftEcharts1, option, {
  168. // interval: 2000,
  169. // loopSeries: true,
  170. // });
  171. //注册
  172. that.leftEcharts1.setOption(option)
  173. },
  174. leftEcharts2Fun () {
  175. let that = this
  176. this.leftEcharts2 = echarts.init(this.$refs['leftEcharts2'])
  177. let nameList = ['a'];
  178. let valueList = that.industryProportion == 1 ? [30] : [70];
  179. let total = 100; // 数据总数
  180. var category = nameList.map((item, index) => {
  181. return {
  182. value: valueList[index],
  183. itemStyle: {
  184. color: new echarts.graphic.LinearGradient(
  185. 1,
  186. 0,
  187. 0,
  188. 1,
  189. [
  190. {
  191. offset: 0,
  192. color: '#40A9FF50',
  193. },
  194. {
  195. offset: 1,
  196. color: '#40A9FF',
  197. },
  198. ],
  199. false
  200. ),
  201. },
  202. };
  203. });
  204. var totalList = [];
  205. var totalBorderList = [];
  206. nameList.map((item, index) => {
  207. totalList.push({
  208. value: total,
  209. itemStyle: {
  210. color: 'rgba(51, 147, 236, 0.29)',
  211. },
  212. });
  213. totalBorderList.push({
  214. value: total,
  215. itemStyle: {
  216. borderColor: 'rgba(51, 147, 236, 0.29)',
  217. color: 'transparent',
  218. },
  219. });
  220. });
  221. var datas = [];
  222. category.forEach((value) => {
  223. datas.push(value.value);
  224. });
  225. option = {
  226. // backgroundColor: 'rgb(231,238,249)',
  227. xAxis: {
  228. max: total,
  229. splitLine: {
  230. show: false,
  231. },
  232. axisLine: {
  233. show: false,
  234. },
  235. axisLabel: {
  236. show: false,
  237. },
  238. axisTick: {
  239. show: false,
  240. },
  241. },
  242. grid: {
  243. left: '0%',
  244. top: '15%', // 设置条形图的边距
  245. right: '15%',
  246. bottom: '5%',
  247. },
  248. yAxis: [
  249. {
  250. type: 'category',
  251. inverse: false,
  252. data: nameList,
  253. axisLine: {
  254. show: false,
  255. },
  256. axisTick: {
  257. show: false,
  258. },
  259. axisLabel: {
  260. show: false,
  261. },
  262. },
  263. ],
  264. series: [
  265. {
  266. // 内
  267. type: 'bar',
  268. barWidth: 16,
  269. barGap: '20%',
  270. silent: true,
  271. // label: {
  272. // normal: {
  273. // formatter: (item) => {
  274. // return `${item['name']}:${item['value']} `;
  275. // },
  276. // textStyle: {
  277. // color: 'rgba(105, 120, 136, 1)',
  278. // fontSize: 14,
  279. // },
  280. // position: [0, '-25px'],
  281. // show: true,
  282. // },
  283. // },
  284. data: category,
  285. z: 1,
  286. itemStyle: {
  287. normal: {
  288. color: new echarts.graphic.LinearGradient(
  289. 1,
  290. 0,
  291. 0,
  292. 1,
  293. [
  294. {
  295. offset: 0,
  296. color: 'rgba(81, 193, 156, 1)',
  297. },
  298. {
  299. offset: 1,
  300. color: 'rgba(234, 177, 100, 1)',
  301. },
  302. ],
  303. false
  304. ),
  305. },
  306. },
  307. animationEasing: 'elasticOut',
  308. },
  309. {
  310. // 分隔
  311. type: 'pictorialBar',
  312. itemStyle: {
  313. normal: {
  314. color: '#143362',
  315. },
  316. },
  317. symbolRepeat: 'fixed',
  318. symbolMargin: 8,
  319. symbol: 'rect',
  320. symbolClip: false,
  321. symbolSize: [4, 20],
  322. symbolPosition: 'start',
  323. symbolOffset: [0, -2],
  324. symbolBoundingData: total,
  325. data: [total, total, total, total],
  326. z: 2,
  327. animationEasing: 'elasticOut',
  328. },
  329. {
  330. // label
  331. type: 'pictorialBar',
  332. symbolBoundingData: total,
  333. itemStyle: {
  334. normal: {
  335. color: 'none',
  336. },
  337. },
  338. label: {
  339. normal: {
  340. formatter: (params) => {
  341. var text;
  342. text = `${((params['data'] * 100) / total).toFixed(2)}亿`;
  343. return text;
  344. },
  345. textStyle: {
  346. // 图列内容样式
  347. fontSize: "20",
  348. fontWeight: 800
  349. },
  350. position: 'right',
  351. offset: [0, -3],
  352. distance: 10, // 向右偏移位置
  353. show: true,
  354. color: '#68BDFF',
  355. },
  356. },
  357. data: datas,
  358. z: 0,
  359. },
  360. {
  361. name: '外框',
  362. type: 'bar',
  363. barGap: '-130%', // 设置外框粗细
  364. data: totalBorderList,
  365. barWidth: 26,
  366. itemStyle: {
  367. normal: {
  368. // barBorderRadius: [5, 5, 5, 5],
  369. borderWidth: 1, // 边框宽度
  370. borderColor: 'rgb(51, 147, 236)', // 边框色
  371. color: 'rgb(231,238,249)'
  372. },
  373. },
  374. z: 0,
  375. }
  376. ],
  377. };
  378. //轮播
  379. // tools.loopShowTooltip(leftEcharts1, option, {
  380. // interval: 2000,
  381. // loopSeries: true,
  382. // });
  383. //注册
  384. that.leftEcharts2.setOption(option)
  385. },
  386. leftEcharts3Fun () {
  387. let that = this
  388. this.leftEcharts3 = echarts.init(this.$refs['leftEcharts3'])
  389. option = {
  390. title: {
  391. text: that.industryProportion == 1 ? '70%' : '30%',
  392. x: 'center',
  393. y: 'center',
  394. textStyle: {
  395. fontWeight: 'normal',
  396. color: '#68BDFF',
  397. fontSize: '20'
  398. }
  399. },
  400. color: ['#5BDCC8', '#254F7F'],
  401. series: [{
  402. name: 'Line 1',
  403. type: 'pie',
  404. clockWise: true,
  405. radius: ['80%', '100%'],
  406. itemStyle: {
  407. normal: {
  408. label: {
  409. show: false
  410. },
  411. labelLine: {
  412. show: false
  413. }
  414. }
  415. },
  416. hoverAnimation: false,
  417. data: [{
  418. value: 80,
  419. name: '01',
  420. itemStyle: {
  421. normal: {
  422. label: {
  423. show: false
  424. },
  425. labelLine: {
  426. show: false
  427. }
  428. }
  429. }
  430. }, {
  431. name: '02',
  432. value: 20
  433. }]
  434. }]
  435. }
  436. //轮播
  437. // tools.loopShowTooltip(leftEcharts1, option, {
  438. // interval: 2000,
  439. // loopSeries: true,
  440. // });
  441. //注册
  442. that.leftEcharts3.setOption(option)
  443. },
  444. leftEcharts4Fun () {
  445. let that = this
  446. this.leftEcharts4 = echarts.init(this.$refs['leftEcharts4'])
  447. let nameList = ['a'];
  448. let valueList = that.industryProportion == 1 ? [70] : [30];
  449. let total = 100; // 数据总数
  450. var category = nameList.map((item, index) => {
  451. return {
  452. value: valueList[index],
  453. itemStyle: {
  454. color: new echarts.graphic.LinearGradient(
  455. 1,
  456. 0,
  457. 0,
  458. 1,
  459. [
  460. {
  461. offset: 0,
  462. color: '#5BDCC850',
  463. },
  464. {
  465. offset: 1,
  466. color: '#5BDCC8',
  467. },
  468. ],
  469. false
  470. ),
  471. },
  472. };
  473. });
  474. var totalList = [];
  475. var totalBorderList = [];
  476. nameList.map((item, index) => {
  477. totalList.push({
  478. value: total,
  479. itemStyle: {
  480. color: 'rgba(51, 147, 236, 0.29)',
  481. },
  482. });
  483. totalBorderList.push({
  484. value: total,
  485. itemStyle: {
  486. borderColor: 'rgba(51, 147, 236, 0.29)',
  487. color: 'transparent',
  488. },
  489. });
  490. });
  491. var datas = [];
  492. category.forEach((value) => {
  493. datas.push(value.value);
  494. });
  495. option = {
  496. // backgroundColor: 'rgb(231,238,249)',
  497. xAxis: {
  498. max: total,
  499. splitLine: {
  500. show: false,
  501. },
  502. axisLine: {
  503. show: false,
  504. },
  505. axisLabel: {
  506. show: false,
  507. },
  508. axisTick: {
  509. show: false,
  510. },
  511. },
  512. grid: {
  513. left: '0%',
  514. top: '15%', // 设置条形图的边距
  515. right: '15%',
  516. bottom: '5%',
  517. },
  518. yAxis: [
  519. {
  520. type: 'category',
  521. inverse: false,
  522. data: nameList,
  523. axisLine: {
  524. show: false,
  525. },
  526. axisTick: {
  527. show: false,
  528. },
  529. axisLabel: {
  530. show: false,
  531. },
  532. },
  533. ],
  534. series: [
  535. {
  536. // 内
  537. type: 'bar',
  538. barWidth: 16,
  539. barGap: '20%',
  540. silent: true,
  541. // label: {
  542. // normal: {
  543. // formatter: (item) => {
  544. // return `${item['name']}:${item['value']} `;
  545. // },
  546. // textStyle: {
  547. // color: 'rgba(105, 120, 136, 1)',
  548. // fontSize: 14,
  549. // },
  550. // position: [0, '-25px'],
  551. // show: true,
  552. // },
  553. // },
  554. data: category,
  555. z: 1,
  556. itemStyle: {
  557. normal: {
  558. color: new echarts.graphic.LinearGradient(
  559. 1,
  560. 0,
  561. 0,
  562. 1,
  563. [
  564. {
  565. offset: 0,
  566. color: 'rgba(81, 193, 156, 1)',
  567. },
  568. {
  569. offset: 1,
  570. color: 'rgba(234, 177, 100, 1)',
  571. },
  572. ],
  573. false
  574. ),
  575. },
  576. },
  577. animationEasing: 'elasticOut',
  578. },
  579. {
  580. // 分隔
  581. type: 'pictorialBar',
  582. itemStyle: {
  583. normal: {
  584. color: '#143362',
  585. },
  586. },
  587. symbolRepeat: 'fixed',
  588. symbolMargin: 8,
  589. symbol: 'rect',
  590. symbolClip: false,
  591. symbolSize: [4, 20],
  592. symbolPosition: 'start',
  593. symbolOffset: [0, -2],
  594. symbolBoundingData: total,
  595. data: [total, total, total, total],
  596. z: 2,
  597. animationEasing: 'elasticOut',
  598. },
  599. {
  600. // label
  601. type: 'pictorialBar',
  602. symbolBoundingData: total,
  603. itemStyle: {
  604. normal: {
  605. color: 'none',
  606. },
  607. },
  608. label: {
  609. normal: {
  610. formatter: (params) => {
  611. var text;
  612. text = `${((params['data'] * 100) / total).toFixed(2)}亿`;
  613. return text;
  614. },
  615. textStyle: {
  616. // 图列内容样式
  617. fontSize: "20",
  618. fontWeight: 800
  619. },
  620. position: 'right',
  621. offset: [0, -3],
  622. distance: 10, // 向右偏移位置
  623. show: true,
  624. color: '#68BDFF',
  625. },
  626. },
  627. data: datas,
  628. z: 0,
  629. },
  630. {
  631. name: '外框',
  632. type: 'bar',
  633. barGap: '-130%', // 设置外框粗细
  634. data: totalBorderList,
  635. barWidth: 26,
  636. itemStyle: {
  637. normal: {
  638. // barBorderRadius: [5, 5, 5, 5],
  639. borderWidth: 1, // 边框宽度
  640. borderColor: 'rgb(51, 147, 236)', // 边框色
  641. color: 'rgb(231,238,249)'
  642. },
  643. },
  644. z: 0,
  645. }
  646. ],
  647. };
  648. //轮播
  649. // tools.loopShowTooltip(leftEcharts1, option, {
  650. // interval: 2000,
  651. // loopSeries: true,
  652. // });
  653. //注册
  654. that.leftEcharts4.setOption(option)
  655. },
  656. leftEcharts5Fun () {
  657. let that = this
  658. this.leftEcharts5 = echarts.init(this.$refs['leftEcharts5'])
  659. let dataList = []
  660. left1[that.industryLayout].forEach((item, index) => {
  661. dataList[index] = {
  662. value: item.y,
  663. name: item.name,
  664. itemStyle: {
  665. normal: {
  666. color: new echarts.graphic.LinearGradient(1, 0, 0, 1, [
  667. {
  668. offset: 0,
  669. color: commonColor2[index], //顶部颜色
  670. },
  671. {
  672. offset: 1,
  673. color: commonColor[index],// 底部颜色
  674. },
  675. ]),
  676. borderColor: commonColor[index],
  677. borderWidth: 3
  678. }
  679. }
  680. }
  681. })
  682. let option = {
  683. tooltip: {
  684. trigger: 'item',
  685. formatter: function (e) {
  686. return `<span style="display:inline-block;margin-right:15px;border-radius:10px;width:20px;height:20px;background-color:${e.borderColor};"></span>${e.name} ${e.percent}%<br>${e.value}亿 ${left1[that.industryLayout][e.seriesIndex].num}个`
  687. },
  688. backgroundColor: 'rgba(50,50,50,0.7)', // 提示框浮层的背景颜色
  689. textStyle: {
  690. color: '#fff',
  691. fontStyle: 'normal', // 文字字体的风格('normal',无样式;'italic',斜体;'oblique',倾斜字体)
  692. fontWeight: 'normal', // 文字字体的粗细('normal',无样式;'bold',加粗;'bolder',加粗的基础上再加粗;'lighter',变细;数字定义粗细也可以,取值范围100至700)
  693. fontSize: '28', // 文字字体大小
  694. },
  695. },
  696. legend: {
  697. top: 'center',
  698. orient: 'vertical',
  699. left: '75%',
  700. textStyle: {
  701. color: '#fff',
  702. fontSize: 28,
  703. padding: [0, 20]
  704. },
  705. },
  706. graphic: {
  707. elements: [{
  708. type: 'image',//需要填充图片,配置image,如果不需要图片可以配置其他的, text, circle, sector, ring, polygon, polyline, rect, line, bezierCurve, arc, group,
  709. style: {
  710. image: './img/whiteCircle.png', //这里添加图片地址
  711. width: 80,
  712. height: 80
  713. },
  714. left: 'center',//
  715. top: 'middle' //配置图片居中
  716. }]
  717. },
  718. series: [
  719. {
  720. name: '',
  721. type: 'pie',
  722. radius: ['20%', '80%'],
  723. labelLine: {
  724. normal: {
  725. lineStyle: {
  726. width: 1,
  727. }
  728. },
  729. },
  730. label: {
  731. "normal": {
  732. "show": false,
  733. "textStyle": {
  734. "fontSize": 28,
  735. color: '#fff'
  736. }
  737. }
  738. },
  739. roseType: 'area',
  740. data: dataList,
  741. },
  742. {
  743. tooltip: {
  744. show: false
  745. },
  746. type: 'pie',
  747. radius: ["80%", "82%"],
  748. hoverAnimation: false,
  749. name: "",
  750. data: [{
  751. name: '',
  752. value: 0,
  753. itemStyle: {
  754. normal: {
  755. color: "#345189"
  756. }
  757. }
  758. }]
  759. },
  760. ],
  761. }
  762. //轮播
  763. tools.loopShowTooltip(that.leftEcharts5, option, {
  764. interval: 2000,
  765. loopSeries: true,
  766. });
  767. //注册
  768. that.leftEcharts5.setOption(option)
  769. },
  770. leftEcharts6Fun () {
  771. let that = this
  772. this.leftEcharts6 = echarts.init(this.$refs['leftEcharts6'])
  773. var dataArr = 44;
  774. var colorSet = {
  775. color: '#22B95E'
  776. };
  777. var color1 = {
  778. type: "linear",
  779. x: 0,
  780. y: 0,
  781. x2: 1,
  782. y2: 1,
  783. colorStops: [
  784. {
  785. offset: 0,
  786. color: "rgba(255,255,255,0.1)"
  787. },
  788. {
  789. offset: 1,
  790. color: "rgba(255,255,255,0.3)"
  791. }
  792. ],
  793. global: false
  794. }
  795. var color2 = {
  796. type: "linear",
  797. x: 0,
  798. y: 0,
  799. x2: 1,
  800. y2: 1,
  801. colorStops: [
  802. {
  803. offset: 0,
  804. color: "#30DBBA"
  805. },
  806. {
  807. offset: 1,
  808. color: "#2DE696"
  809. }
  810. ],
  811. global: false
  812. }
  813. option = {
  814. tooltip: {
  815. formatter: "{a} <br/>{b} : {c}%"
  816. },
  817. series: [
  818. {
  819. name: "内部进度条",
  820. type: "gauge",
  821. // center: ['20%', '50%'],
  822. radius: '50%',
  823. splitNumber: 10,
  824. axisLine: {
  825. lineStyle: {
  826. color: [
  827. [dataArr / 100, 'rgba(0,0,0,0)'],
  828. [1, 'rgba(0,0,0,0)']
  829. ],
  830. width: 1
  831. }
  832. },
  833. axisLabel: {
  834. show: false,
  835. },
  836. axisTick: {
  837. show: false,
  838. },
  839. splitLine: {
  840. show: false,
  841. },
  842. itemStyle: {
  843. color: "#ffffff"
  844. },
  845. detail: {
  846. formatter: function (value) {
  847. if (value !== 0) {
  848. var num = Math.round(value);
  849. return parseInt(num).toFixed(0) + "%";
  850. } else {
  851. return 0;
  852. }
  853. },
  854. offsetCenter: [0, 117],
  855. textStyle: {
  856. padding: [0, 0, 0, 0],
  857. fontSize: 60,
  858. color: "#58F7DF"
  859. }
  860. },
  861. title: { //标题
  862. show: true,
  863. offsetCenter: [0, 220], // x, y,单位px
  864. textStyle: {
  865. color: "#40A9FF",
  866. fontSize: 34, //表盘上的标题文字大小
  867. fontWeight: 400,
  868. fontFamily: 'MicrosoftYaHei'
  869. }
  870. },
  871. data: [{
  872. name: "总额度:1,323.85亿",
  873. value: dataArr,
  874. itemStyle: {
  875. fontSize: '50', //y轴上方单位的大小
  876. color: "#FFF666",
  877. fontFamily: "MicrosoftYaHei",
  878. }
  879. }],
  880. pointer: {
  881. show: true,
  882. length: '100%',
  883. radius: '20%',
  884. width: 3 //指针粗细
  885. },
  886. animationDuration: 4000,
  887. },
  888. {
  889. name: "内部阴影",
  890. type: "gauge",
  891. radius: '75%',
  892. splitNumber: 10,
  893. axisLine: {
  894. lineStyle: {
  895. color: [
  896. [dataArr / 100, new echarts.graphic.LinearGradient(
  897. 0, 1, 0, 0, [{
  898. offset: 0,
  899. color: '#081947',
  900. }, {
  901. offset: 0.5,
  902. color: '#5DF5A9',
  903. },
  904. {
  905. offset: 1,
  906. color: '#F6F16A',
  907. }
  908. ]
  909. )],
  910. [
  911. 1, '#0E4889'
  912. ]
  913. ],
  914. width: 70
  915. },
  916. },
  917. axisLabel: {
  918. show: false,
  919. },
  920. axisTick: {
  921. show: false,
  922. },
  923. splitLine: {
  924. show: false,
  925. },
  926. itemStyle: {
  927. show: false,
  928. },
  929. },
  930. {
  931. name: '外部刻度',
  932. type: 'gauge',
  933. // center: ['20%', '50%'],
  934. radius: '90%',
  935. min: 0, //最小刻度
  936. max: 100, //最大刻度
  937. splitNumber: 5, //刻度数量
  938. startAngle: 225,
  939. endAngle: -45,
  940. axisLine: {
  941. show: true,
  942. lineStyle: {
  943. width: 1,
  944. color: [
  945. [1, 'rgba(0,0,0,0)']
  946. ]
  947. }
  948. }, //仪表盘轴线
  949. axisLabel: {
  950. show: false,
  951. color: '#ffffff',
  952. fontSize: 28,
  953. fontFamily: 'SourceHanSansSC-Regular',
  954. fontWeight: 'bold',
  955. // position: "top",
  956. distance: -45,
  957. formatter: function (v) {
  958. switch (v + '') {
  959. case '0':
  960. return '0';
  961. case '10':
  962. return '10';
  963. case '20':
  964. return '20';
  965. case '30':
  966. return '30';
  967. case '40':
  968. return '40';
  969. case '50':
  970. return '50';
  971. case '60':
  972. return '60';
  973. case '70':
  974. return '70';
  975. case '80':
  976. return '80';
  977. case '90':
  978. return '90';
  979. case '100':
  980. return '100';
  981. }
  982. }
  983. }, //刻度标签。
  984. axisTick: {
  985. show: true,
  986. splitNumber: 10,
  987. lineStyle: {
  988. color: '#3798D7', //用颜色渐变函数不起作用
  989. width: 1,
  990. },
  991. length: -6
  992. }, //刻度样式
  993. splitLine: {
  994. show: true,
  995. length: -12,
  996. lineStyle: {
  997. color: '#3798D7', //用颜色渐变函数不起作用
  998. }
  999. }, //分隔线样式
  1000. detail: {
  1001. show: false
  1002. }
  1003. },
  1004. { //指针上的圆
  1005. type: 'pie',
  1006. tooltip: {
  1007. show: false
  1008. },
  1009. hoverAnimation: false,
  1010. legendHoverLink: false,
  1011. radius: ['0%', '4%'],
  1012. center: ['50%', '50%'],
  1013. label: {
  1014. normal: {
  1015. show: false
  1016. }
  1017. },
  1018. labelLine: {
  1019. normal: {
  1020. show: false
  1021. }
  1022. },
  1023. data: [{
  1024. value: 120,
  1025. itemStyle: {
  1026. normal: {
  1027. color: "#ffffff",
  1028. },
  1029. }
  1030. }]
  1031. },
  1032. ]
  1033. };
  1034. //轮播
  1035. // tools.loopShowTooltip(leftEcharts1, option, {
  1036. // interval: 2000,
  1037. // loopSeries: true,
  1038. // });
  1039. //注册
  1040. that.leftEcharts6.setOption(option)
  1041. },
  1042. leftEcharts7Fun () {
  1043. let that = this
  1044. this.leftEcharts7 = echarts.init(this.$refs['leftEcharts7'])
  1045. let option = {
  1046. title: {
  1047. text: '固定资产进度分布',
  1048. textStyle: {
  1049. color: '#fff',
  1050. fontSize: 28,
  1051. fontWeight: 500,
  1052. fontFamily: 'Microsoft YaHei'
  1053. },
  1054. top: '20',
  1055. left: '220'
  1056. },
  1057. textStyle: {
  1058. color: '#fff',
  1059. },
  1060. tooltip: {
  1061. show: false,
  1062. trigger: "axis",
  1063. formatter: function (params) {
  1064. var tip = params[0].axisValue + '<br/>' + params[0].marker + params[0].data[1] + ':' + params[0].data[2] + '个,' + params[0].data[3] + '亿元' + '<br/>' + params[1].marker + params[1].data[1] + ':' + params[1].data[2] + '个,' + params[1].data[3] + '亿元';
  1065. return tip
  1066. },
  1067. textStyle: {
  1068. color: '#ffffff', // 文字的颜色
  1069. fontSize: '20', // 文字字体大小
  1070. fontFamily: 'Microsoft YaHei'
  1071. },
  1072. axisPointer: {
  1073. // lineStyle: {
  1074. // type: 'dashed',
  1075. // width: 2,
  1076. // color: 'rgba(255,255,255,0.6)'
  1077. // },
  1078. animation: false
  1079. }
  1080. },
  1081. grid: {
  1082. top: '0%',
  1083. right: '5%',
  1084. left: '15%',
  1085. bottom: '-10%',
  1086. },
  1087. yAxis: {
  1088. data: ['备案', '特别监管'],
  1089. splitLine: {
  1090. show: false,
  1091. lineStyle: {
  1092. color: '#68b4dd66',
  1093. type: 'dashed',
  1094. },
  1095. },
  1096. axisLine: {
  1097. show: false
  1098. },
  1099. axisLabel: {
  1100. show: true,
  1101. formatter: '{value}',
  1102. textStyle: {
  1103. color: function (data) {
  1104. if (data == '特别监管') {
  1105. return '#40A9FF'
  1106. } else if (data == '备案') {
  1107. return '#5BDCC8'
  1108. }
  1109. },
  1110. fontSize: 20,
  1111. padding: [0, -10, 0, 0],
  1112. fontFamily: 'Microsoft YaHei',
  1113. },
  1114. },
  1115. nameTextStyle: {
  1116. color: '#ebf8ac',
  1117. fontSize: 16,
  1118. fontFamily: 'Microsoft YaHei'
  1119. },
  1120. },
  1121. xAxis: {
  1122. data: ['项目储备', '项目立项', '可研论证', '投资决策'],
  1123. axisLine: {
  1124. show: true, //隐藏X轴轴线
  1125. lineStyle: {
  1126. color: 'red',
  1127. width: 1,
  1128. },
  1129. },
  1130. axisTick: {
  1131. show: false, //隐藏X轴刻度
  1132. },
  1133. axisLabel: {
  1134. show: true,
  1135. textStyle: {
  1136. color: '#fff', //X轴文字颜色
  1137. fontSize: 20,
  1138. padding: [-80, 0, 0, 0],
  1139. fontFamily: 'Microsoft YaHei'
  1140. },
  1141. }
  1142. },
  1143. series: [
  1144. {
  1145. name: '特别监管',
  1146. type: 'scatter',
  1147. symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  1148. symbolSize: function (data) {
  1149. return Math.sqrt(data[2]) * 5;
  1150. },
  1151. // label: {
  1152. // emphasis: {
  1153. // show: true,
  1154. // formatter: function (param) {
  1155. // return param.data[2];
  1156. // },
  1157. // position: 'top'
  1158. // }
  1159. // },
  1160. itemStyle: {
  1161. normal: {
  1162. color: '#69c0ff'
  1163. }
  1164. },
  1165. // data: left13[0]
  1166. },
  1167. {
  1168. name: '备案',
  1169. type: 'scatter',
  1170. symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  1171. symbolSize: function (data) {
  1172. return Math.sqrt(data[2]) * 5;
  1173. },
  1174. // label: {
  1175. // emphasis: {
  1176. // show: true,
  1177. // formatter: function (param) {
  1178. // return param.data[2];
  1179. // },
  1180. // position: 'top'
  1181. // }
  1182. // },
  1183. itemStyle: {
  1184. normal: {
  1185. color: '#957DFF'
  1186. }
  1187. },
  1188. // data: left13[1]
  1189. },
  1190. ]
  1191. }
  1192. //轮播
  1193. // tools.loopShowTooltip(leftEcharts1, option, {
  1194. // interval: 2000,
  1195. // loopSeries: true,
  1196. // });
  1197. //注册
  1198. that.leftEcharts7.setOption(option)
  1199. },
  1200. leftEcharts8Fun () {
  1201. let that = this
  1202. this.leftEcharts8 = echarts.init(this.$refs['leftEcharts8'])
  1203. let option = {
  1204. title: {
  1205. text: '固定资产进度分布',
  1206. textStyle: {
  1207. color: '#fff',
  1208. fontSize: 28,
  1209. fontWeight: 500,
  1210. fontFamily: 'Microsoft YaHei'
  1211. },
  1212. top: '20',
  1213. left: '220'
  1214. },
  1215. textStyle: {
  1216. color: '#fff',
  1217. },
  1218. tooltip: {
  1219. show: false,
  1220. trigger: "axis",
  1221. formatter: function (params) {
  1222. var tip = params[0].axisValue + '<br/>' + params[0].marker + params[0].data[1] + ':' + params[0].data[2] + '个,' + params[0].data[3] + '亿元' + '<br/>' + params[1].marker + params[1].data[1] + ':' + params[1].data[2] + '个,' + params[1].data[3] + '亿元';
  1223. return tip
  1224. },
  1225. textStyle: {
  1226. color: '#ffffff', // 文字的颜色
  1227. fontSize: '20', // 文字字体大小
  1228. fontFamily: 'Microsoft YaHei'
  1229. },
  1230. axisPointer: {
  1231. // lineStyle: {
  1232. // type: 'dashed',
  1233. // width: 2,
  1234. // color: 'rgba(255,255,255,0.6)'
  1235. // },
  1236. animation: false
  1237. }
  1238. },
  1239. grid: {
  1240. top: '0%',
  1241. right: '5%',
  1242. left: '15%',
  1243. bottom: '-10%',
  1244. },
  1245. yAxis: {
  1246. data: ['备案', '特别监管'],
  1247. splitLine: {
  1248. show: false,
  1249. lineStyle: {
  1250. color: '#68b4dd66',
  1251. type: 'dashed',
  1252. },
  1253. },
  1254. axisLine: {
  1255. show: false
  1256. },
  1257. axisLabel: {
  1258. show: false,
  1259. formatter: '{value}',
  1260. textStyle: {
  1261. color: '#fff',
  1262. fontSize: 20,
  1263. padding: [0, -10, 0, 0],
  1264. fontFamily: 'Microsoft YaHei',
  1265. },
  1266. },
  1267. nameTextStyle: {
  1268. color: '#ebf8ac',
  1269. fontSize: 16,
  1270. fontFamily: 'Microsoft YaHei'
  1271. },
  1272. },
  1273. xAxis: {
  1274. data: ['项目储备', '项目立项', '可研论证', '投资决策'],
  1275. axisLine: {
  1276. show: true, //隐藏X轴轴线
  1277. lineStyle: {
  1278. color: 'red',
  1279. width: 1,
  1280. },
  1281. },
  1282. axisTick: {
  1283. show: false, //隐藏X轴刻度
  1284. },
  1285. axisLabel: {
  1286. show: true,
  1287. textStyle: {
  1288. color: '#fff', //X轴文字颜色
  1289. fontSize: 20,
  1290. padding: [-80, 0, 0, 0],
  1291. fontFamily: 'Microsoft YaHei'
  1292. },
  1293. }
  1294. },
  1295. series: [
  1296. {
  1297. name: '特别监管',
  1298. type: 'scatter',
  1299. symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  1300. symbolSize: function (data) {
  1301. return Math.sqrt(data[2]) * 5;
  1302. },
  1303. // label: {
  1304. // emphasis: {
  1305. // show: true,
  1306. // formatter: function (param) {
  1307. // return param.data[2];
  1308. // },
  1309. // position: 'top'
  1310. // }
  1311. // },
  1312. itemStyle: {
  1313. normal: {
  1314. color: '#69c0ff'
  1315. }
  1316. },
  1317. // data: left13[0]
  1318. },
  1319. {
  1320. name: '备案',
  1321. type: 'scatter',
  1322. symbol: 'circle',//'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
  1323. symbolSize: function (data) {
  1324. return Math.sqrt(data[2]) * 5;
  1325. },
  1326. // label: {
  1327. // emphasis: {
  1328. // show: true,
  1329. // formatter: function (param) {
  1330. // return param.data[2];
  1331. // },
  1332. // position: 'top'
  1333. // }
  1334. // },
  1335. itemStyle: {
  1336. normal: {
  1337. color: '#957DFF'
  1338. }
  1339. },
  1340. // data: left13[1]
  1341. },
  1342. ]
  1343. }
  1344. //轮播
  1345. // tools.loopShowTooltip(leftEcharts1, option, {
  1346. // interval: 2000,
  1347. // loopSeries: true,
  1348. // });
  1349. //注册
  1350. that.leftEcharts8.setOption(option)
  1351. },
  1352. chinaEchartsFun () {
  1353. this.geoCoordMap = []
  1354. /*获取地图数据*/
  1355. this.shanxiMap = echarts.init(this.$refs['shanxi'])
  1356. // echarts.registerMap('china', china)
  1357. echarts.registerMap('china', shanxi)
  1358. // var mapFeatures = echarts.getMap('china').geoJson.features
  1359. // mapFeatures.forEach(v => {
  1360. // // 地区名称
  1361. // var name = v.properties.name
  1362. // // 地区经纬度
  1363. // this.geoCoordMap[name] = v.properties.cp
  1364. // data.push({ name: v.properties.name, value: v.properties.cp[0], value2: v.properties.cp[1] })
  1365. // })
  1366. // var data = [
  1367. // { "name": "新疆", value: 29780 },
  1368. // { "name": "西藏", value: 2186 },
  1369. // { "name": "内蒙古", value: 1135 },
  1370. // { "name": "青海", value: 29780 },
  1371. // { "name": "四川", value: 2568 },
  1372. // { "name": "黑龙江", value: 29780 },
  1373. // { "name": "甘肃", value: 6959 },
  1374. // { "name": "云南", value: 5632 },
  1375. // { "name": "广西", value: 6707 },
  1376. // { "name": "湖南", value: 29780 },
  1377. // { "name": "陕西", value: 1894 },
  1378. // { "name": "广东", value: 15769 },
  1379. // { "name": "吉林", value: 8259 },
  1380. // { "name": "河北", value: 5741 },
  1381. // { "name": "湖北", value: 3030 },
  1382. // { "name": "贵州", value: 4542 },
  1383. // { "name": "山东", value: 19780 },
  1384. // { "name": "江西", value: 3157 },
  1385. // { "name": "河南", value: 6690 },
  1386. // { "name": "辽宁", value: 8678 },
  1387. // { "name": "山西", value: 5303 },
  1388. // { "name": "安徽", value: 29780 },
  1389. // { "name": "福建", value: 10259 },
  1390. // { "name": "浙江", value: 3016 },
  1391. // { "name": "江苏", value: 3202 },
  1392. // { "name": "重庆", value: 4540 },
  1393. // { "name": "宁夏", value: 19780 },
  1394. // { "name": "海南", value: 8626 },
  1395. // { "name": "台湾", value: 4361 },
  1396. // { "name": "北京", value: 20000 },
  1397. // { "name": "天津", value: 4080 },
  1398. // { "name": "上海", value: 19780 },
  1399. // { "name": "香港", value: 6991 },
  1400. // { "name": "澳门", value: 13873 },
  1401. // { "name": "南海诸岛", value: 0 }
  1402. // ];
  1403. // var geoCoordMap = {
  1404. // "新疆": [86.9023, 41.148],
  1405. // "西藏": [87.8695, 31.6846],
  1406. // "内蒙古": [110.5977, 41.3408],
  1407. // "青海": [95.2402, 35.4199],
  1408. // "四川": [102.9199, 30.1904],
  1409. // "黑龙江": [128.1445, 46.7156],
  1410. // "甘肃": [102.7129, 38.166],
  1411. // "云南": [101.0652, 24.6807],
  1412. // "广西": [108.7813, 23.6426],
  1413. // "湖南": [111.5332, 27.3779],
  1414. // "陕西": [108.5996, 33.7396],
  1415. // "广东": [113.8668, 22.8076],
  1416. // "吉林": [126.1746, 43.5938],
  1417. // "河北": [115.4004, 38.1688],
  1418. // "湖北": [112.2363, 30.8572],
  1419. // "贵州": [106.6113, 26.6385],
  1420. // "山东": [118.2402, 36.2307],
  1421. // "江西": [115.7156, 27.99],
  1422. // "河南": [113.0668, 33.8818],
  1423. // "辽宁": [123.0438, 41.0889],
  1424. // "山西": [112.44, 37.73],
  1425. // "安徽": [117.2461, 31.0361],
  1426. // "福建": [118.3008, 25.9277],
  1427. // "浙江": [120.498, 29.0918],
  1428. // "江苏": [119.8586, 32.915],
  1429. // "重庆": [107.7539, 29.8904],
  1430. // "宁夏": [105.9961, 37.1096],
  1431. // "海南": [109.9512, 19.2041],
  1432. // "台湾": [120.8254, 23.5986],
  1433. // "北京": [116.4551, 40.2539],
  1434. // "天津": [117.4219, 39.4189],
  1435. // "上海": [121.4648, 31.2891],
  1436. // "香港": [114.6178, 22.3242],
  1437. // "澳门": [113.5547, 21.6484],
  1438. // '南海诸岛': [128.8254, 21.5986]
  1439. // };
  1440. var data = [
  1441. { name: '大同市', value: 6035, value2: 28 },
  1442. { name: '朔州市', value: 3361, value2: 13 },
  1443. { name: '忻州市', value: 7335, value2: 25 },
  1444. { name: '吕梁市', value: 10904, value2: 45 },
  1445. { name: '太原市', value: 25167, value2: 113 },
  1446. { name: '阳泉市', value: 2512, value2: 28 },
  1447. { name: '晋中市', value: 14857, value2: 52 },
  1448. { name: '临汾市', value: 13055, value2: 30 },
  1449. { name: '长治市', value: 10300, value2: 23 },
  1450. { name: '运城市', value: 4106, value2: 23 },
  1451. { name: '晋城市', value: 4543, value2: 31 }
  1452. ]
  1453. var geoCoordMap = {
  1454. '太原市': [112.53, 37.87],
  1455. '大同市': [113.3, 40.12],
  1456. '阳泉市': [113.57, 37.85],
  1457. '长治市': [113.08, 36.18],
  1458. '晋城市': [112.83, 35.52],
  1459. '朔州市': [112.43, 39.33],
  1460. '晋中市': [112.94, 37.4],
  1461. '运城市': [110.97, 35.03],
  1462. '忻州市': [112.53, 38.72],
  1463. '临汾市': [111.5, 36.08],
  1464. '吕梁市': [111.13, 37.52],
  1465. }
  1466. var convertData = function (data) {
  1467. var res = [];
  1468. for (var i = 0; i < data.length; i++) {
  1469. var geoCoord = geoCoordMap[data[i].name];
  1470. if (geoCoord) {
  1471. res.push({
  1472. name: data[i].name,
  1473. value: geoCoord.concat(data[i].value)
  1474. });
  1475. }
  1476. }
  1477. return res;
  1478. };
  1479. var convertedData = [
  1480. convertData(data),
  1481. convertData(data.sort(function (a, b) {
  1482. return b.value - a.value;
  1483. }).slice(0, 6))
  1484. ];
  1485. data.sort(function (a, b) {
  1486. return a.value - b.value;
  1487. })
  1488. option = {
  1489. // backgroundColor: '#404a59',
  1490. animation: true,
  1491. animationDuration: 1000,
  1492. animationEasing: 'cubicInOut',
  1493. animationDurationUpdate: 1000,
  1494. animationEasingUpdate: 'cubicInOut',
  1495. geo: {
  1496. map: 'china',
  1497. center: [112.53, 37.67],
  1498. zoom: 4.5,
  1499. label: {
  1500. emphasis: {
  1501. show: false
  1502. }
  1503. },
  1504. tooltip:{
  1505. trigger: 'item',
  1506. formatter: function (params) {
  1507. console.log(params,'??????????')
  1508. }
  1509. },
  1510. roam: false,
  1511. itemStyle: {
  1512. normal: {
  1513. // borderColor: 'rgba(147, 235, 248, 1)',
  1514. borderColor: '#7fb3ff',
  1515. borderWidth: 3,
  1516. areaColor: {
  1517. type: 'radial',
  1518. x: 0.5,
  1519. y: 0.5,
  1520. r: 0.8,
  1521. colorStops: [{
  1522. offset: 0,
  1523. color: '#468ff8' // 0% 处的颜色
  1524. }, {
  1525. offset: 1,
  1526. color: '#0a2c6d' // 100% 处的颜色
  1527. }],
  1528. globalCoord: false // 缺省为 false
  1529. },
  1530. // shadowColor: 'rgba(128, 217, 248, 1)',
  1531. shadowColor: '#468ff8',
  1532. shadowOffsetX: -2,
  1533. shadowOffsetY: 2,
  1534. shadowBlur: 20
  1535. },
  1536. emphasis: {
  1537. areaColor: {
  1538. colorStops: [{
  1539. offset: 0,
  1540. color: '#3844aa' // 0% 处的颜色
  1541. }, {
  1542. offset: 1,
  1543. color: '#7284fc' // 100% 处的颜色
  1544. }],
  1545. },
  1546. borderColor: '#b3baff',
  1547. borderWidth: 5
  1548. }
  1549. },
  1550. regions: [
  1551. {
  1552. name: '太原市',
  1553. value: 2000,
  1554. itemStyle: {
  1555. emphasis: {
  1556. borderColor: '#ffe036',
  1557. borderWidth: 5,
  1558. areaColor: {
  1559. type: 'radial',
  1560. x: 0.5,
  1561. y: 0.5,
  1562. r: 0.8,
  1563. colorStops: [{
  1564. offset: 0,
  1565. color: '#ffe036' // 0% 处的颜色
  1566. }, {
  1567. offset: 1,
  1568. color: '#7c732a' // 100% 处的颜色
  1569. }],
  1570. globalCoord: false // 缺省为 false
  1571. },
  1572. }
  1573. }
  1574. },
  1575. {
  1576. name: "南海诸岛",
  1577. itemStyle: {
  1578. // 隐藏地图
  1579. normal: {
  1580. opacity: 0, // 为 0 时不绘制该图形
  1581. }
  1582. },
  1583. label: {
  1584. show: false // 隐藏文字
  1585. }
  1586. }
  1587. ],
  1588. },
  1589. tooltip: {
  1590. trigger: 'item',
  1591. className: 'custom-tooltip-box',
  1592. confine: true, // 不超出当前表
  1593. formatter: function (params) {
  1594. console.log(params)
  1595. return `<div class="bgTooltip" style="background: url('../img/shanxi/${params.name}.png') no-repeat center center;background-size: 100% 100%;font-size:36px">
  1596. <div class="flex items-center">
  1597. <img src="./img/yellowArrow.png" style="width: 12px;height: 22px;margin-right:10px" alt=""><span class="fb">${params.name}</span>
  1598. </div>
  1599. <div class="blueIcon flex items-center">项目数量:<span class="fb" style="color:#68BDFF;">26<span style="font-size:20px" class="fn">个</span></span></div>
  1600. <div class="blueIcon flex items-center">投资总额:<span class="fb" style="color:#68BDFF">180<span style="font-size:20px" class="fn">亿</span></span></div>
  1601. </div>`
  1602. },
  1603. },
  1604. xAxis: {
  1605. type: 'value',
  1606. scale: true,
  1607. position: 'top',
  1608. boundaryGap: false,
  1609. splitLine: {
  1610. show: false
  1611. },
  1612. axisLine: {
  1613. show: false
  1614. },
  1615. axisTick: {
  1616. show: false
  1617. },
  1618. axisLabel: {
  1619. margin: 2,
  1620. textStyle: {
  1621. color: '#aaa'
  1622. }
  1623. },
  1624. },
  1625. yAxis: {
  1626. type: 'category',
  1627. nameGap: 16,
  1628. axisLine: {
  1629. show: false,
  1630. lineStyle: {
  1631. color: '#ddd'
  1632. }
  1633. },
  1634. axisTick: {
  1635. show: false,
  1636. lineStyle: {
  1637. color: '#ddd'
  1638. }
  1639. },
  1640. axisLabel: {
  1641. interval: 0,
  1642. textStyle: {
  1643. color: '#ddd'
  1644. }
  1645. },
  1646. data: categoryData
  1647. },
  1648. series: [
  1649. {
  1650. type: 'effectScatter',
  1651. coordinateSystem: 'geo',
  1652. data: convertedData[0],
  1653. symbolSize: function (val) {
  1654. return Math.max(val[2] / 500, 8);
  1655. },
  1656. showEffectOn: 'render',
  1657. rippleEffect: {
  1658. brushType: 'stroke'
  1659. },
  1660. hoverAnimation: true,
  1661. label: {
  1662. normal: {
  1663. formatter: '{b}',
  1664. position: 'right',
  1665. show: true,
  1666. fontSize: '30',
  1667. color: '#fff'
  1668. }
  1669. },
  1670. itemStyle: {
  1671. normal: {
  1672. color: '#ffc809',
  1673. shadowBlur: 50,
  1674. shadowColor: '#ffc809',
  1675. fontSize: "500",
  1676. }
  1677. },
  1678. zlevel: 1
  1679. }
  1680. ]
  1681. };
  1682. var categoryData = [];
  1683. var barData = [];
  1684. var sum = 0;
  1685. for (var i = 0; i < data.length; i++) {
  1686. categoryData.push(data[i].name);
  1687. barData.push(data[i].value);
  1688. sum += data[i].value;
  1689. }
  1690. let that = this
  1691. // this.shanxiMap.on('click', function (params) {
  1692. // if (params.name == '山西') {
  1693. // that.shanxiMap.dispose()
  1694. // that.centerShow = true
  1695. // setTimeout(() => {
  1696. // })
  1697. // }
  1698. // })
  1699. tools.loopShowTooltip(this.shanxiMap, option, {
  1700. interval: 2000,
  1701. loopSeries: false,
  1702. });
  1703. this.shanxiMap.setOption(option)
  1704. },
  1705. }
  1706. })