index3.js 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133
  1. $(function () {
  2. char_4();
  3. map();
  4. Gender();
  5. char_1();
  6. char_2();
  7. char_3();
  8. /**/
  9. char_5();
  10. char_6();
  11. char_7();
  12. char_8();
  13. function map() {
  14. var myChart = echarts.init(document.getElementById('china'));
  15. var geoCoordMap = {
  16. '新疆玛纳斯基地': [86.22, 44.30],
  17. '九江': [116.00, 29.70],
  18. '新乡': [116.402217, 35.311657],
  19. ' ': [79.92, 37.12],
  20. ' ': [86.85, 47.70],
  21. '若羌县': [88.17, 39.02],
  22. '上海': [121.4648, 31.2891],
  23. '东莞': [113.8953, 22.901],
  24. '东营': [118.7073, 37.5513],
  25. '中山': [113.4229, 22.478],
  26. '临汾': [111.4783, 36.1615],
  27. '临沂': [118.3118, 35.2936],
  28. '丹东': [124.541, 40.4242],
  29. '丽水': [119.5642, 28.1854],
  30. '乌鲁木齐': [87.9236, 43.5883],
  31. '佛山': [112.8955, 23.1097],
  32. '保定': [115.0488, 39.0948],
  33. '兰州': [103.5901, 36.3043],
  34. '包头': [110.3467, 41.4899],
  35. '北京': [116.4551, 40.2539],
  36. '北海': [109.314, 21.6211],
  37. '南京': [118.8062, 31.9208],
  38. '南宁': [108.479, 23.1152],
  39. '南昌': [116.0046, 28.6633],
  40. '南通': [121.1023, 32.1625],
  41. '厦门': [118.1689, 24.6478],
  42. '台州': [121.1353, 28.6688],
  43. '合肥': [117.29, 32.0581],
  44. '呼和浩特': [111.4124, 40.4901],
  45. '咸阳': [108.4131, 34.8706],
  46. '哈尔滨': [127.9688, 45.368],
  47. '唐山': [118.4766, 39.6826],
  48. '嘉兴': [120.9155, 30.6354],
  49. '大同': [113.7854, 39.8035],
  50. '大连': [122.2229, 39.4409],
  51. '天津': [117.4219, 39.4189],
  52. '太原': [112.3352, 37.9413],
  53. '威海': [121.9482, 37.1393],
  54. '宁波': [121.5967, 29.6466],
  55. '宝鸡': [107.1826, 34.3433],
  56. '宿迁': [118.5535, 33.7775],
  57. '常州': [119.4543, 31.5582],
  58. '广州': [113.5107, 23.2196],
  59. '廊坊': [116.521, 39.0509],
  60. '延安': [109.1052, 36.4252],
  61. '张家口': [115.1477, 40.8527],
  62. '徐州': [117.5208, 34.3268],
  63. '德州': [116.6858, 37.2107],
  64. '惠州': [114.6204, 23.1647],
  65. '成都': [103.9526, 30.7617],
  66. '扬州': [119.4653, 32.8162],
  67. '承德': [117.5757, 41.4075],
  68. '拉萨': [91.1865, 30.1465],
  69. '无锡': [120.3442, 31.5527],
  70. '日照': [119.2786, 35.5023],
  71. '昆明': [102.9199, 25.4663],
  72. '杭州': [119.5313, 29.8773],
  73. '枣庄': [117.323, 34.8926],
  74. '柳州': [109.3799, 24.9774],
  75. '株洲': [113.5327, 27.0319],
  76. '武汉': [114.3896, 30.6628],
  77. '汕头': [117.1692, 23.3405],
  78. '江门': [112.6318, 22.1484],
  79. '沈阳': [123.1238, 42.1216],
  80. '沧州': [116.8286, 38.2104],
  81. '河源': [114.917, 23.9722],
  82. '泉州': [118.3228, 25.1147],
  83. '泰安': [117.0264, 36.0516],
  84. '泰州': [120.0586, 32.5525],
  85. '济南': [117.1582, 36.8701],
  86. '济宁': [116.8286, 35.3375],
  87. '海口': [110.3893, 19.8516],
  88. '淄博': [118.0371, 36.6064],
  89. '淮安': [118.927, 33.4039],
  90. '深圳': [114.5435, 22.5439],
  91. '清远': [112.9175, 24.3292],
  92. '温州': [120.498, 27.8119],
  93. '渭南': [109.7864, 35.0299],
  94. '湖州': [119.8608, 30.7782],
  95. '湘潭': [112.5439, 27.7075],
  96. '滨州': [117.8174, 37.4963],
  97. '潍坊': [119.0918, 36.524],
  98. '烟台': [120.7397, 37.5128],
  99. '玉溪': [101.9312, 23.8898],
  100. '珠海': [113.7305, 22.1155],
  101. '盐城': [120.2234, 33.5577],
  102. '盘锦': [121.9482, 41.0449],
  103. '石家庄': [114.4995, 38.1006],
  104. '福州': [119.4543, 25.9222],
  105. '秦皇岛': [119.2126, 40.0232],
  106. '绍兴': [120.564, 29.7565],
  107. '聊城': [115.9167, 36.4032],
  108. '肇庆': [112.1265, 23.5822],
  109. '舟山': [122.2559, 30.2234],
  110. '苏州': [120.6519, 31.3989],
  111. '莱芜': [117.6526, 36.2714],
  112. '菏泽': [115.6201, 35.2057],
  113. '营口': [122.4316, 40.4297],
  114. '葫芦岛': [120.1575, 40.578],
  115. '衡水': [115.8838, 37.7161],
  116. '衢州': [118.6853, 28.8666],
  117. '西宁': [101.4038, 36.8207],
  118. '西安': [109.1162, 34.2004],
  119. '贵阳': [106.6992, 26.7682],
  120. '连云港': [119.1248, 34.552],
  121. '邢台': [114.8071, 37.2821],
  122. '邯郸': [114.4775, 36.535],
  123. '郑州': [113.4668, 34.6234],
  124. '鄂尔多斯': [108.9734, 39.2487],
  125. '重庆': [107.7539, 30.1904],
  126. '金华': [120.0037, 29.1028],
  127. '铜川': [109.0393, 35.1947],
  128. '银川': [106.3586, 38.1775],
  129. '镇江': [119.4763, 31.9702],
  130. '长春': [125.8154, 44.2584],
  131. '长沙': [113.0823, 28.2568],
  132. '长治': [112.8625, 36.4746],
  133. '阳泉': [113.4778, 38.0951],
  134. '青岛': [120.4651, 36.3373],
  135. '韶关': [113.7964, 24.7028]
  136. };
  137. var BJData = [
  138. [{
  139. name: '新乡'
  140. }, {
  141. name: '新乡',
  142. value: 200
  143. }],
  144. [{
  145. name: '新乡'
  146. }, {
  147. name: '呼和浩特',
  148. value: 90
  149. }],
  150. [{
  151. name: '新乡'
  152. }, {
  153. name: '哈尔滨',
  154. value: 90
  155. }],
  156. [{
  157. name: '新乡'
  158. }, {
  159. name: '石家庄',
  160. value: 90
  161. }],
  162. [{
  163. name: '新乡'
  164. }, {
  165. name: '昆明',
  166. value: 30
  167. }],
  168. [{
  169. name: '新乡'
  170. }, {
  171. name: '北京',
  172. value: 100
  173. }],
  174. [{
  175. name: '新乡'
  176. }, {
  177. name: '长春',
  178. value: 40
  179. }],
  180. [{
  181. name: '新乡'
  182. }, {
  183. name: '重庆',
  184. value: 40
  185. }],
  186. [{
  187. name: '新乡'
  188. }, {
  189. name: '贵阳',
  190. value: 50
  191. }],
  192. [{
  193. name: '新乡'
  194. }, {
  195. name: '南宁',
  196. value: 30
  197. }],
  198. [{
  199. name: '新乡'
  200. }, {
  201. name: '济南',
  202. value: 10
  203. }],
  204. [{
  205. name: '新乡'
  206. }, {
  207. name: '太原',
  208. value: 40
  209. }],
  210. [{
  211. name: '新乡'
  212. }, {
  213. name: '西安',
  214. value: 60
  215. }],
  216. [{
  217. name: '新乡'
  218. }, {
  219. name: '武汉',
  220. value: 50
  221. }],
  222. [{
  223. name: '新乡'
  224. }, {
  225. name: '合肥',
  226. value: 40
  227. }],
  228. [{
  229. name: '新乡'
  230. }, {
  231. name: '南京',
  232. value: 30
  233. }],
  234. [{
  235. name: '新乡'
  236. }, {
  237. name: '沈阳',
  238. value: 20
  239. }],
  240. [{
  241. name: '新乡'
  242. }, {
  243. name: '成都',
  244. value: 10
  245. }]
  246. ];
  247. var SHData = [
  248. [{
  249. name: '九江'
  250. }, {
  251. name: '九江',
  252. value: 200
  253. }],
  254. [{
  255. name: '九江'
  256. }, {
  257. name: '长沙',
  258. value: 95
  259. }],
  260. [{
  261. name: '九江'
  262. }, {
  263. name: '武汉',
  264. value: 30
  265. }],
  266. [{
  267. name: '九江'
  268. }, {
  269. name: '南昌',
  270. value: 20
  271. }],
  272. [{
  273. name: '九江'
  274. }, {
  275. name: '合肥',
  276. value: 70
  277. }],
  278. [{
  279. name: '九江'
  280. }, {
  281. name: '南京',
  282. value: 60
  283. }],
  284. [{
  285. name: '九江'
  286. }, {
  287. name: '福州',
  288. value: 50
  289. }],
  290. [{
  291. name: '九江'
  292. }, {
  293. name: '上海',
  294. value: 100
  295. }],
  296. [{
  297. name: '九江'
  298. }, {
  299. name: '深圳',
  300. value: 100
  301. }],
  302. ];
  303. var GZData = [
  304. [{
  305. name: '新疆玛纳斯基地'
  306. }, {
  307. name: '新疆玛纳斯基地',
  308. value: 200
  309. }],
  310. [{
  311. name: '新疆玛纳斯基地'
  312. }, {
  313. name: ' ',
  314. value: 90
  315. }],
  316. [{
  317. name: '新疆玛纳斯基地'
  318. }, {
  319. name: ' ',
  320. value: 40
  321. }],
  322. [{
  323. name: '新疆玛纳斯基地'
  324. }, {
  325. name: '呼和浩特',
  326. value: 90
  327. }],
  328. [{
  329. name: '新疆玛纳斯基地'
  330. }, {
  331. name: '昆明',
  332. value: 40
  333. }],
  334. [{
  335. name: '新疆玛纳斯基地'
  336. }, {
  337. name: '成都',
  338. value: 10
  339. }],
  340. [{
  341. name: '新疆玛纳斯基地'
  342. }, {
  343. name: '兰州',
  344. value: 95
  345. }],
  346. [{
  347. name: '新疆玛纳斯基地'
  348. }, {
  349. name: '银川',
  350. value: 90
  351. }],
  352. [{
  353. name: '新疆玛纳斯基地'
  354. }, {
  355. name: '西宁',
  356. value: 80
  357. }],
  358. ];
  359. var planePath = 'path://M.6,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705';
  360. var convertData = function(data) {
  361. var res = [];
  362. for (var i = 0; i < data.length; i++) {
  363. var dataItem = data[i];
  364. var fromCoord = geoCoordMap[dataItem[0].name];
  365. var toCoord = geoCoordMap[dataItem[1].name];
  366. if (fromCoord && toCoord) {
  367. res.push([{
  368. coord: fromCoord
  369. }, {
  370. coord: toCoord
  371. }]);
  372. }
  373. }
  374. return res;
  375. };
  376. var color = ['#3ed4ff', '#ffa022', '#a6c84c'];
  377. var series = [];
  378. [
  379. ['新乡', BJData],
  380. ['九江', SHData],
  381. ['新疆', GZData]
  382. ].forEach(function(item, i) {
  383. series.push({
  384. name: item[0] + ' Top10',
  385. type: 'lines',
  386. zlevel: 1,
  387. effect: {
  388. show: true,
  389. period: 6,
  390. trailLength: 0.7,
  391. color: '#fff',
  392. symbolSize: 3
  393. },
  394. lineStyle: {
  395. normal: {
  396. color: color[i],
  397. width: 0,
  398. curveness: 0.2
  399. }
  400. },
  401. data: convertData(item[1])
  402. }, {
  403. name: item[0] + ' Top10',
  404. type: 'lines',
  405. zlevel: 2,
  406. effect: {
  407. show: true,
  408. period: 6,
  409. trailLength: 0,
  410. symbol: planePath,
  411. symbolSize: 15
  412. },
  413. lineStyle: {
  414. normal: {
  415. color: color[i],
  416. width: 1,
  417. opacity: 0.4,
  418. curveness: 0.2
  419. }
  420. },
  421. data: convertData(item[1])
  422. }, {
  423. name: item[0] + ' Top10',
  424. type: 'effectScatter',
  425. coordinateSystem: 'geo',
  426. zlevel: 2,
  427. rippleEffect: {
  428. brushType: 'stroke'
  429. },
  430. label: {
  431. normal: {
  432. show: true,
  433. position: 'right',
  434. formatter: '{b}'
  435. }
  436. },
  437. symbolSize: function(val) {
  438. return val[2] / 8;
  439. },
  440. itemStyle: {
  441. normal: {
  442. color: color[i]
  443. }
  444. },
  445. data: item[1].map(function(dataItem) {
  446. return {
  447. name: dataItem[1].name,
  448. value: geoCoordMap[dataItem[1].name].concat([dataItem[1].value])
  449. };
  450. })
  451. });
  452. });
  453. option = {
  454. /*backgroundColor: '#080a20',*/
  455. title: {
  456. text: '物流情况',
  457. subtext: '',
  458. left: 'left',
  459. textStyle: {
  460. color: '#fff'
  461. }
  462. },
  463. tooltip: {
  464. trigger: 'item'
  465. },
  466. legend: {
  467. orient: 'vertical',
  468. top: 'bottom',
  469. left: 'right',
  470. data: ['北京 Top10', '上海 Top10', '广州 Top10'],
  471. textStyle: {
  472. color: '#fff'
  473. },
  474. selectedMode: 'single'
  475. },
  476. geo: {
  477. map: 'china',
  478. label: {
  479. emphasis: {
  480. show: false
  481. }
  482. },
  483. roam: true,
  484. itemStyle: {
  485. normal: {
  486. areaColor: '#132937',
  487. borderColor: '#0692a4'
  488. },
  489. emphasis: {
  490. areaColor: '#0b1c2d'
  491. }
  492. }
  493. },
  494. series: series
  495. };
  496. // 使用刚指定的配置项和数据显示图表。
  497. myChart.setOption(option);
  498. window.addEventListener("resize",function(){
  499. myChart.resize();
  500. });
  501. }
  502. function Gender() {
  503. var myChart = echarts.init(document.getElementById('Gender'));
  504. var symbols = [
  505. 'path://M18.2629891,11.7131596 L6.8091608,11.7131596 C1.6685112,11.7131596 0,13.032145 0,18.6237673 L0,34.9928467 C0,38.1719847 4.28388932,38.1719847 4.28388932,34.9928467 L4.65591984,20.0216948 L5.74941883,20.0216948 L5.74941883,61.000787 C5.74941883,65.2508314 11.5891201,65.1268798 11.5891201,61.000787 L11.9611506,37.2137775 L13.1110872,37.2137775 L13.4831177,61.000787 C13.4831177,65.1268798 19.3114787,65.2508314 19.3114787,61.000787 L19.3114787,20.0216948 L20.4162301,20.0216948 L20.7882606,34.9928467 C20.7882606,38.1719847 25.0721499,38.1719847 25.0721499,34.9928467 L25.0721499,18.6237673 C25.0721499,13.032145 23.4038145,11.7131596 18.2629891,11.7131596 M12.5361629,1.11022302e-13 C15.4784742,1.11022302e-13 17.8684539,2.38997966 17.8684539,5.33237894 C17.8684539,8.27469031 15.4784742,10.66467 12.5361629,10.66467 C9.59376358,10.66467 7.20378392,8.27469031 7.20378392,5.33237894 C7.20378392,2.38997966 9.59376358,1.11022302e-13 12.5361629,1.11022302e-13',
  506. 'path://M28.9624207,31.5315864 L24.4142575,16.4793596 C23.5227152,13.8063773 20.8817445,11.7111088 17.0107398,11.7111088 L12.112691,11.7111088 C8.24168636,11.7111088 5.60080331,13.8064652 4.70917331,16.4793596 L0.149791395,31.5315864 C-0.786976655,34.7595013 2.9373074,35.9147532 3.9192135,32.890727 L8.72689855,19.1296485 L9.2799493,19.1296485 C9.2799493,19.1296485 2.95992025,43.7750224 2.70031069,44.6924335 C2.56498417,45.1567684 2.74553639,45.4852068 3.24205501,45.4852068 L8.704461,45.4852068 L8.704461,61.6700801 C8.704461,64.9659872 13.625035,64.9659872 13.625035,61.6700801 L13.625035,45.360657 L15.5097899,45.360657 L15.4984835,61.6700801 C15.4984835,64.9659872 20.4191451,64.9659872 20.4191451,61.6700801 L20.4191451,45.4852068 L25.8814635,45.4852068 C26.3667633,45.4852068 26.5586219,45.1567684 26.4345142,44.6924335 C26.1636859,43.7750224 19.8436568,19.1296485 19.8436568,19.1296485 L20.3966199,19.1296485 L25.2043926,32.890727 C26.1862111,35.9147532 29.9105828,34.7595013 28.9625083,31.5315864 L28.9624207,31.5315864 Z M14.5617154,0 C17.4960397,0 19.8773132,2.3898427 19.8773132,5.33453001 C19.8773132,8.27930527 17.4960397,10.66906 14.5617154,10.66906 C11.6274788,10.66906 9.24611767,8.27930527 9.24611767,5.33453001 C9.24611767,2.3898427 11.6274788,0 14.5617154,0 L14.5617154,0 Z',
  507. 'path://M512 292.205897c80.855572 0 146.358821-65.503248 146.358821-146.358821C658.358821 65.503248 592.855572 0 512 0 431.144428 0 365.641179 65.503248 365.641179 146.358821 365.641179 227.214393 431.144428 292.205897 512 292.205897zM512 731.282359c-80.855572 0-146.358821 65.503248-146.358821 146.358821 0 80.855572 65.503248 146.358821 146.358821 146.358821 80.855572 0 146.358821-65.503248 146.358821-146.358821C658.358821 796.273863 592.855572 731.282359 512 731.282359z'
  508. ];
  509. var bodyMax = 100; //指定图形界限的值
  510. var labelSetting = {
  511. normal: {
  512. show: true,
  513. position: 'bottom',
  514. offset: [0, 10],
  515. formatter: function(param) {
  516. return (param.value / bodyMax * 100).toFixed(0) + '%';
  517. },
  518. textStyle: {
  519. fontSize: 18,
  520. fontFamily: 'Arial',
  521. color: '#ffffff'
  522. }
  523. }
  524. };
  525. var markLineSetting = { //设置标线
  526. symbol: 'none',
  527. lineStyle: {
  528. normal: {
  529. opacity: 0.3
  530. }
  531. },
  532. data: [{
  533. type: 'max',
  534. label: {
  535. normal: {
  536. formatter: 'max: {c}'
  537. }
  538. }
  539. }, {
  540. type: 'min',
  541. label: {
  542. normal: {
  543. formatter: 'min: {c}'
  544. }
  545. }
  546. }]
  547. };
  548. option = {
  549. tooltip: {
  550. show: false, //鼠标放上去显示悬浮数据
  551. },
  552. legend: {
  553. data: ['男性', '女性'],
  554. selectedMode: 'single',
  555. itemWidth: 10, //图例的宽度
  556. itemHeight: 10, //图例的高度
  557. itemGap: 30,
  558. orient: 'horizontal',
  559. left: 'center',
  560. top: '20px',
  561. icon: 'rect',
  562. // selectedMode: false, //取消图例上的点击事件
  563. textStyle: {
  564. color: '#ffffff'
  565. },
  566. },
  567. grid: {
  568. // left: '20%',
  569. // right: '20%',
  570. top: '20%',
  571. bottom: '20%',
  572. containLabel: true
  573. },
  574. xAxis: {
  575. data: ['a', 'x', 'b'],
  576. axisTick: {
  577. show: false
  578. },
  579. axisLine: {
  580. show: false
  581. },
  582. axisLabel: {
  583. show: false
  584. }
  585. },
  586. yAxis: {
  587. max: bodyMax,
  588. splitLine: {
  589. show: false
  590. },
  591. axisTick: {
  592. // 刻度线
  593. show: false
  594. },
  595. axisLine: {
  596. // 轴线
  597. show: false
  598. },
  599. axisLabel: {
  600. // 轴坐标文字
  601. show: false
  602. }
  603. },
  604. series: [{
  605. name: '男性',
  606. type: 'pictorialBar',
  607. symbolClip: true,
  608. symbolBoundingData: bodyMax,
  609. label: labelSetting,
  610. data: [{
  611. value: 35,
  612. symbol: symbols[0],
  613. itemStyle: {
  614. normal: {
  615. color: 'rgba(105,204,230)' //单独控制颜色
  616. }
  617. },
  618. },
  619. {
  620. },
  621. {
  622. value: 65,
  623. symbol: symbols[1],
  624. itemStyle: {
  625. normal: {
  626. color: 'rgba(255,130,130)' //单独控制颜色
  627. }
  628. },
  629. }
  630. ],
  631. // markLine: markLineSetting,
  632. z: 10
  633. },
  634. {
  635. name: '女性',
  636. type: 'pictorialBar',
  637. symbolClip: true,
  638. symbolBoundingData: bodyMax,
  639. label: labelSetting,
  640. data: [{
  641. value: 70,
  642. symbol: symbols[0]
  643. },
  644. {},
  645. {
  646. value: 30,
  647. symbol: symbols[1]
  648. }
  649. ],
  650. // markLine: markLineSetting,
  651. z: 10
  652. },
  653. {
  654. // 设置背景底色,不同的情况用这个
  655. name: 'full',
  656. type: 'pictorialBar', //异型柱状图 图片、SVG PathData
  657. symbolBoundingData: bodyMax,
  658. animationDuration: 0,
  659. itemStyle: {
  660. normal: {
  661. color: '#ccc' //设置全部颜色,统一设置
  662. }
  663. },
  664. z: 10,
  665. data: [{
  666. itemStyle: {
  667. normal: {
  668. color: 'rgba(105,204,230,0.40)' //单独控制颜色
  669. }
  670. },
  671. value: 100,
  672. symbol: symbols[0]
  673. },
  674. {
  675. // 设置中间冒号
  676. itemStyle: {
  677. normal: {
  678. color: '#1DA1F2' //单独控制颜色
  679. }
  680. },
  681. value: 100,
  682. symbol: symbols[2],
  683. symbolSize: [8, '18%'],
  684. symbolOffset: [0, '-200%']
  685. },
  686. {
  687. itemStyle: {
  688. normal: {
  689. color: 'rgba(255,130,130,0.40)' //单独控制颜色
  690. }
  691. },
  692. value: 100,
  693. symbol: symbols[1]
  694. }
  695. ]
  696. }
  697. ]
  698. }
  699. // 使用刚指定的配置项和数据显示图表。
  700. myChart.setOption(option);
  701. window.addEventListener("resize",function(){
  702. myChart.resize();
  703. });
  704. }
  705. function char_1() {
  706. var myChart = echarts.init(document.getElementById('char_1'));
  707. var myColor = ['#eb2100', '#eb3600', '#d0570e', '#d0a00e', '#34da62', '#00e9db', '#00c0e9', '#0096f3', '#33CCFF', '#33FFCC'];
  708. option = {
  709. /*backgroundColor: '#0e2147',*/
  710. grid: {
  711. left: '11%',
  712. top: '12%',
  713. right: '0%',
  714. bottom: '8%',
  715. containLabel: true
  716. },
  717. xAxis: [{
  718. show: false,
  719. }],
  720. yAxis: [{
  721. axisTick: 'none',
  722. axisLine: 'none',
  723. offset: '27',
  724. axisLabel: {
  725. textStyle: {
  726. color: '#ffffff',
  727. fontSize: '16',
  728. }
  729. },
  730. /*data: ['南昌转运中心', '广州转运中心', '杭州转运中心', '宁夏转运中心', '兰州转运中心', '南宁转运中心', '长沙转运中心', '武汉转运中心', '合肥转运中心', '贵州转运中心']*/
  731. data: ['兰州转运中心', '南宁转运中心', '长沙转运中心', '武汉转运中心', '合肥转运中心', '贵州转运中心']
  732. }, {
  733. axisTick: 'none',
  734. axisLine: 'none',
  735. axisLabel: {
  736. textStyle: {
  737. color: '#ffffff',
  738. fontSize: '14',
  739. }
  740. },
  741. data: ['6', '5', '4', '3', '2', '1']
  742. }, {
  743. name: '分拨延误TOP 10',
  744. nameGap: '50',
  745. nameTextStyle: {
  746. color: '#ffffff',
  747. fontSize: '14',
  748. },
  749. axisLine: {
  750. lineStyle: {
  751. color: 'rgba(0,0,0,0)'
  752. }
  753. },
  754. data: [],
  755. }],
  756. series: [{
  757. name: '条',
  758. type: 'bar',
  759. yAxisIndex: 0,
  760. data: [ 38, 44, 50, 52, 60, 72],
  761. label: {
  762. normal: {
  763. show: true,
  764. position: 'right',
  765. textStyle: {
  766. color: '#ffffff',
  767. fontSize: '10',
  768. }
  769. }
  770. },
  771. barWidth: 5,
  772. itemStyle: {
  773. normal: {
  774. color: function(params) {
  775. var num = myColor.length;
  776. return myColor[params.dataIndex % num]
  777. },
  778. }
  779. },
  780. z: 2
  781. }, {
  782. name: '白框',
  783. type: 'bar',
  784. yAxisIndex: 1,
  785. barGap: '-100%',
  786. data: [99.5, 99.5, 99.5, 99.5, 99.5, 99.5],
  787. barWidth: 5,
  788. itemStyle: {
  789. normal: {
  790. color: '#0e2147',
  791. barBorderRadius: 5,
  792. }
  793. },
  794. z: 1
  795. }, {
  796. name: '外框',
  797. type: 'bar',
  798. yAxisIndex: 2,
  799. barGap: '-100%',
  800. data: [100, 100, 100, 100, 100, 100],
  801. barWidth: 12,
  802. itemStyle: {
  803. normal: {
  804. color: function(params) {
  805. var num = myColor.length;
  806. return myColor[params.dataIndex % num]
  807. },
  808. barBorderRadius: 5,
  809. }
  810. },
  811. z: 0
  812. },
  813. {
  814. name: '外圆',
  815. type: 'scatter',
  816. hoverAnimation: false,
  817. data: [ 0, 0, 0, 0, 0, 0],
  818. yAxisIndex: 2,
  819. symbolSize: 15,
  820. itemStyle: {
  821. normal: {
  822. color: function(params) {
  823. var num = myColor.length;
  824. return myColor[params.dataIndex % num]
  825. },
  826. opacity: 1,
  827. }
  828. },
  829. z: 2
  830. }
  831. ]
  832. };
  833. // 使用刚指定的配置项和数据显示图表。
  834. myChart.setOption(option);
  835. window.addEventListener("resize",function(){
  836. myChart.resize();
  837. });
  838. }
  839. function char_2() {
  840. var myChart = echarts.init(document.getElementById('char_2'));
  841. var myColor = ['#eb2100', '#eb3600', '#d0570e', '#d0a00e', '#34da62', '#00e9db', '#00c0e9', '#0096f3', '#33CCFF', '#33FFCC'];
  842. option = {
  843. /*backgroundColor: '#0e2147',*/
  844. grid: {
  845. left: '11%',
  846. top: '12%',
  847. right: '0%',
  848. bottom: '8%',
  849. containLabel: true
  850. },
  851. xAxis: [{
  852. show: false,
  853. }],
  854. yAxis: [{
  855. axisTick: 'none',
  856. axisLine: 'none',
  857. offset: '27',
  858. axisLabel: {
  859. textStyle: {
  860. color: '#ffffff',
  861. fontSize: '16',
  862. }
  863. },
  864. /*data: ['南昌转运中心', '广州转运中心', '杭州转运中心', '宁夏转运中心', '兰州转运中心', '南宁转运中心', '长沙转运中心', '武汉转运中心', '合肥转运中心', '贵州转运中心']*/
  865. data: ['兰州转运中心', '南宁转运中心', '长沙转运中心', '武汉转运中心', '合肥转运中心', '贵州转运中心']
  866. }, {
  867. axisTick: 'none',
  868. axisLine: 'none',
  869. axisLabel: {
  870. textStyle: {
  871. color: '#ffffff',
  872. fontSize: '14',
  873. }
  874. },
  875. data: ['6', '5', '4', '3', '2', '1']
  876. }, {
  877. name: '分拨延误TOP 10',
  878. nameGap: '50',
  879. nameTextStyle: {
  880. color: '#ffffff',
  881. fontSize: '14',
  882. },
  883. axisLine: {
  884. lineStyle: {
  885. color: 'rgba(0,0,0,0)'
  886. }
  887. },
  888. data: [],
  889. }],
  890. series: [{
  891. name: '条',
  892. type: 'bar',
  893. yAxisIndex: 0,
  894. data: [ 8, 14, 20, 32, 35, 42],
  895. label: {
  896. normal: {
  897. show: true,
  898. position: 'right',
  899. textStyle: {
  900. color: '#ffffff',
  901. fontSize: '10',
  902. }
  903. }
  904. },
  905. barWidth: 10,
  906. itemStyle: {
  907. normal: {
  908. color: function(params) {
  909. var num = myColor.length;
  910. return myColor[params.dataIndex % num]
  911. },
  912. }
  913. },
  914. z: 2
  915. }, {
  916. name: '白框',
  917. type: 'bar',
  918. yAxisIndex: 1,
  919. barGap: '-50%',
  920. data: [50,50,50,50,50,50],
  921. barWidth: 10,
  922. itemStyle: {
  923. normal: {
  924. color: '#0e2147',
  925. barBorderRadius: 5,
  926. }
  927. },
  928. z: 1
  929. }, {
  930. name: '外框',
  931. type: 'bar',
  932. yAxisIndex: 2,
  933. barGap: '-500%',
  934. data: [50,50,50,50,50,50],
  935. barWidth: 12,
  936. itemStyle: {
  937. normal: {
  938. color: function(params) {
  939. var num = myColor.length;
  940. return myColor[params.dataIndex % num]
  941. },
  942. barBorderRadius: 5,
  943. }
  944. },
  945. z: 0
  946. },
  947. {
  948. name: '外圆',
  949. type: 'scatter',
  950. hoverAnimation: false,
  951. data: [ 0, 0, 0, 0, 0, 0],
  952. yAxisIndex: 2,
  953. symbolSize: 15,
  954. itemStyle: {
  955. normal: {
  956. color: function(params) {
  957. var num = myColor.length;
  958. return myColor[params.dataIndex % num]
  959. },
  960. opacity: 1,
  961. }
  962. },
  963. z: 2
  964. }
  965. ]
  966. };
  967. // 使用刚指定的配置项和数据显示图表。
  968. myChart.setOption(option);
  969. window.addEventListener("resize",function(){
  970. myChart.resize();
  971. });
  972. }
  973. function char_3() {
  974. var myChart = echarts.init(document.getElementById('chart_3'));
  975. let seriesLineData = []
  976. let LineData = [{
  977. name: '破损件',
  978. data: [5, 12, 3, 23, 4, 21, 12, 34, 23, 13, 45, 5, 12, 3, 23, 4, 21, 12, 34, 23, 13, 45, 3, 23, 4, 21, 12, 34],
  979. color: ['#2773fa', '#051f48']
  980. },
  981. {
  982. name: '丢失件',
  983. data: [15, 2, 13, 20, 14, 20, 11, 24, 21, 33, 12, 2, 12, 42, 5, 6, 4, 15, 31, 23, 11, 22, 5, 33, 14, 31, 22, 14],
  984. color: ['#14c3fc', '#022536']
  985. },
  986. {
  987. name: '损坏件',
  988. data: [12, 32, 32, 33, 11, 1, 33, 2, 23, 12, 35, 2, 13, 22, 23, 34, 12, 34, 11, 22, 12, 11, 23, 12, 22, 13, 12, 23],
  989. color: ['#5deefe', '#01323a']
  990. },
  991. {
  992. name: '拒收件',
  993. data: [6, 2, 23, 12, 22, 21, 12, 23, 12, 44, 12, 22, 13, 23, 11, 12, 23, 45, 12, 5, 23, 12, 14, 23, 13, 23, 45, 12],
  994. color: ['#fff369', '#353910']
  995. },
  996. {
  997. name: '未签收',
  998. data: [16, 22, 13, 22, 32, 11, 22, 12, 34, 11, 23, 12, 23, 12, 34, 11, 23, 23, 12, 23, 12, 34, 11, 22, 11, 22, 12, 23],
  999. color: ['#ffaf48', '#0f1e21']
  1000. }
  1001. ];
  1002. for (var i = 0; i < LineData.length; i++) {
  1003. seriesLineData.push({
  1004. name: LineData[i].name,
  1005. type: 'line',
  1006. smooth: true,
  1007. symbol: "none", //去掉折线点
  1008. stack: i, //数据区叠加 问题
  1009. symbolSize: 5, //折线点的大小
  1010. areaStyle: {
  1011. normal: {
  1012. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  1013. offset: 0,
  1014. color: LineData[i].color[1]
  1015. }, {
  1016. offset: 0.8,
  1017. color: LineData[i].color[1]
  1018. },
  1019. {
  1020. offset: 1,
  1021. color: '#0f1e21' // 100% 处的颜色
  1022. }
  1023. ], false),
  1024. }
  1025. },
  1026. itemStyle: {
  1027. normal: {
  1028. color: LineData[i].color[0],
  1029. borderColor: LineData[i].color[0],
  1030. borderWidth: 12
  1031. }
  1032. },
  1033. data: LineData[i].data,
  1034. })
  1035. }
  1036. option = {
  1037. /*backgroundColor: '#02121e',*/
  1038. title: {
  1039. text: '单位 / 件',
  1040. textStyle: {
  1041. fontSize: 12,
  1042. fontWeight: 'normal',
  1043. color: '#c7cbcd' //标题颜色
  1044. },
  1045. left: '2%',
  1046. },
  1047. tooltip: {
  1048. trigger: 'axis',
  1049. axisPointer: {
  1050. type: 'cross',
  1051. label: {
  1052. backgroundColor: '#6a7985'
  1053. },
  1054. }
  1055. },
  1056. legend: {
  1057. icon: "roundRect",
  1058. orient: 'horizontal', //图例朝向
  1059. // data: ['空闲', '训练事件'],
  1060. textStyle: {
  1061. fontSize: 12, //字体大小
  1062. color: '#c7cbcd', //字体颜色
  1063. },
  1064. itemWidth: 10,
  1065. itemHeight: 5,
  1066. right: '3%' //距离右侧
  1067. },
  1068. grid: {
  1069. left: '3%',
  1070. top: '5%',
  1071. right: '4%',
  1072. bottom: '3%',
  1073. containLabel: true
  1074. },
  1075. xAxis: [{
  1076. type: 'category',
  1077. boundaryGap: false,
  1078. data: ['广州', '浙江', '上海', '福建', '江西', '安徽', '湖南', '湖北', '河南', '河北', '北京', '山西', '陕西', '贵州', '云南', '广西', '重庆', '四川', '内蒙', '辽宁', '黑龙江', '江西', '山东', '吉林', '青海', '海南', '宁夏', '天津'],
  1079. axisLabel: {
  1080. interval:0,
  1081. rotate:40,//倾斜角度
  1082. show: true,
  1083. textStyle: {
  1084. color: '#c7cbcd'
  1085. }
  1086. },
  1087. axisLine: {
  1088. lineStyle: {
  1089. color: '#0a2b52',
  1090. width: 0.5, //这里是为了突出显示加上的
  1091. }
  1092. }
  1093. }],
  1094. yAxis: [{
  1095. type: 'value',
  1096. // splitNumber : 10,
  1097. interval: 10, //坐标抽分割间隔
  1098. axisLine: {
  1099. onZero: false,
  1100. lineStyle: {
  1101. color: '#0a2b52',
  1102. width: 1, //这里是为了突出显示加上的
  1103. }
  1104. },
  1105. axisLabel: {
  1106. show: true,
  1107. textStyle: {
  1108. color: '#c7cbcd' //字体颜色
  1109. }
  1110. },
  1111. splitLine: { //保留网格线
  1112. show: true,
  1113. lineStyle: { //y轴网格线设置
  1114. color: '#0a2b52',
  1115. width: 1,
  1116. type: 'dashed'
  1117. }
  1118. },
  1119. }],
  1120. series: seriesLineData
  1121. };
  1122. // 使用刚指定的配置项和数据显示图表。
  1123. myChart.setOption(option);
  1124. window.addEventListener("resize",function(){
  1125. myChart.resize();
  1126. });
  1127. }
  1128. function char_4() {
  1129. var myChart = echarts.init(document.getElementById('maps'));
  1130. //var uploadedDataURL = "./js/data-1519279347346-BkslpCjwf.json";
  1131. var uploadedDataURL = "./js/data-1576140623415-kSH4vRQ1.json";
  1132. $.getJSON(uploadedDataURL, function(geoJson) {
  1133. echarts.registerMap('jiangxi', geoJson);
  1134. var chinaGeoCoordMap = {
  1135. "合肥市": [117.29, 32.0581],
  1136. "亳州市": [116.1914, 33.4698],
  1137. "六安市": [116.3123, 31.8329],
  1138. "安庆市": [116.7517, 30.5255],
  1139. "宣城市": [118.8062, 30.6244],
  1140. "宿州市": [117.5208, 33.6841],
  1141. "池州市": [117.3889, 30.2014],
  1142. "淮北市": [116.6968, 33.6896],
  1143. "淮南市": [116.7847, 32.7722],
  1144. "滁州市": [118.1909, 32.536],
  1145. "芜湖市": [118.3557, 31.0858],
  1146. "蚌埠市": [117.4109, 33.1073],
  1147. "铜陵市": [117.9382, 30.9375],
  1148. "阜阳市": [115.7629, 32.9919],
  1149. "马鞍山市": [118.6304, 31.5363],
  1150. "黄山市": [118.0481, 29.9542]
  1151. };
  1152. var chinaDatas = [
  1153. [{
  1154. name: '合肥市',
  1155. value: 0
  1156. }],
  1157. [{
  1158. name: '亳州市',
  1159. value: 0
  1160. }],
  1161. [{
  1162. name: '六安市',
  1163. value: 0
  1164. }],
  1165. [{
  1166. name: '安庆市',
  1167. value: 0
  1168. }],
  1169. [{
  1170. name: '宣城市',
  1171. value: 0
  1172. }],
  1173. [{
  1174. name: '宿州市',
  1175. value: 0
  1176. }],
  1177. [{
  1178. name: '池州市',
  1179. value: 0
  1180. }],
  1181. [{
  1182. name: '淮北市',
  1183. value: 0
  1184. }],
  1185. [{
  1186. name: '淮南市',
  1187. value: 0
  1188. }],
  1189. [{
  1190. name: '滁州市',
  1191. value: 0
  1192. }],
  1193. [{
  1194. name: '芜湖市',
  1195. value: 0
  1196. }],
  1197. [{
  1198. name: '蚌埠市',
  1199. value: 0
  1200. }],
  1201. [{
  1202. name: '铜陵市',
  1203. value: 0
  1204. }],
  1205. [{
  1206. name: '阜阳市',
  1207. value: 0
  1208. }],
  1209. [{
  1210. name: '马鞍山市',
  1211. value: 0
  1212. }],
  1213. [{
  1214. name: '黄山市',
  1215. value: 0
  1216. }]
  1217. ];
  1218. var convertData = function(data) {
  1219. var res = [];
  1220. for (var i = 0; i < data.length; i++) {
  1221. var dataItem = data[i];
  1222. var fromCoord = chinaGeoCoordMap[dataItem[0].name];
  1223. var toCoord = [117.29, 32.0581];
  1224. if (fromCoord && toCoord) {
  1225. res.push([{
  1226. coord: fromCoord,
  1227. value: dataItem[0].value
  1228. }, {
  1229. coord: toCoord,
  1230. }]);
  1231. }
  1232. }
  1233. return res;
  1234. };
  1235. var series = [];
  1236. [['合肥市', chinaDatas]].forEach(function(item, i) {
  1237. console.log(item)
  1238. series.push({
  1239. type: 'lines',
  1240. zlevel: 2,
  1241. effect: {
  1242. show: true,
  1243. period: 4, //箭头指向速度,值越小速度越快
  1244. trailLength: 0.02, //特效尾迹长度[0,1]值越大,尾迹越长重
  1245. symbol: 'arrow', //箭头图标
  1246. symbolSize: 5, //图标大小
  1247. },
  1248. lineStyle: {
  1249. normal: {
  1250. width: 1, //尾迹线条宽度
  1251. opacity: 1, //尾迹线条透明度
  1252. curveness: .3 //尾迹线条曲直度
  1253. }
  1254. },
  1255. data: convertData(item[1])
  1256. }, {
  1257. type: 'effectScatter',
  1258. coordinateSystem: 'geo',
  1259. zlevel: 2,
  1260. rippleEffect: { //涟漪特效
  1261. period: 4, //动画时间,值越小速度越快
  1262. brushType: 'stroke', //波纹绘制方式 stroke, fill
  1263. scale: 4 //波纹圆环最大限制,值越大波纹越大
  1264. },
  1265. label: {
  1266. normal: {
  1267. show: true,
  1268. position: 'right', //显示位置
  1269. offset: [5, 0], //偏移设置
  1270. formatter: function(params) { //圆环显示文字
  1271. return params.data.name;
  1272. },
  1273. fontSize: 13
  1274. },
  1275. emphasis: {
  1276. show: true
  1277. }
  1278. },
  1279. symbol: 'circle',
  1280. symbolSize: function(val) {
  1281. return 5 + val[2] * 5; //圆环大小
  1282. },
  1283. itemStyle: {
  1284. normal: {
  1285. show: false,
  1286. color: '#f00'
  1287. }
  1288. },
  1289. data: item[1].map(function(dataItem) {
  1290. return {
  1291. name: dataItem[0].name,
  1292. value: chinaGeoCoordMap[dataItem[0].name].concat([dataItem[0].value])
  1293. };
  1294. }),
  1295. },
  1296. //被攻击点
  1297. {
  1298. type: 'scatter',
  1299. coordinateSystem: 'geo',
  1300. zlevel: 2,
  1301. rippleEffect: {
  1302. period: 4,
  1303. brushType: 'stroke',
  1304. scale: 4
  1305. },
  1306. label: {
  1307. normal: {
  1308. show: true,
  1309. position: 'right',
  1310. //offset:[5, 0],
  1311. color: '#0f0',
  1312. formatter: '{b}',
  1313. textStyle: {
  1314. color: "#0f0"
  1315. }
  1316. },
  1317. emphasis: {
  1318. show: true,
  1319. color: "#f60"
  1320. }
  1321. },
  1322. symbol: 'pin',
  1323. symbolSize: 50,
  1324. data: [{
  1325. name: item[0],
  1326. value: chinaGeoCoordMap[item[0]].concat([10]),
  1327. }],
  1328. }
  1329. );
  1330. });
  1331. option = {
  1332. tooltip: {
  1333. trigger: 'item',
  1334. backgroundColor: 'rgba(166, 200, 76, 0.82)',
  1335. borderColor: '#FFFFCC',
  1336. showDelay: 0,
  1337. hideDelay: 0,
  1338. enterable: true,
  1339. transitionDuration: 0,
  1340. extraCssText: 'z-index:100',
  1341. formatter: function(params, ticket, callback) {
  1342. //根据业务自己拓展要显示的内容
  1343. var res = "";
  1344. var name = params.name;
  1345. var value = params.value[params.seriesIndex + 1];
  1346. res = "<span style='color:#fff;'>" + name + "</span><br/>数据:" + value;
  1347. return res;
  1348. }
  1349. },
  1350. /*backgroundColor: "#013954",*/
  1351. visualMap: { //图例值控制
  1352. min: 0,
  1353. max: 1,
  1354. calculable: true,
  1355. show: true,
  1356. color: ['#f44336', '#fc9700', '#ffde00', '#ffde00', '#00eaff'],
  1357. textStyle: {
  1358. color: '#fff'
  1359. }
  1360. },
  1361. geo: {
  1362. map: 'jiangxi',
  1363. zoom: 1.2,
  1364. label: {
  1365. emphasis: {
  1366. show: false
  1367. }
  1368. },
  1369. roam: true, //是否允许缩放
  1370. itemStyle: {
  1371. normal: {
  1372. color: 'rgba(51, 69, 89, .5)', //地图背景色
  1373. borderColor: '#516a89', //省市边界线00fcff 516a89
  1374. borderWidth: 1
  1375. },
  1376. emphasis: {
  1377. color: 'rgba(37, 43, 61, .5)' //悬浮背景
  1378. }
  1379. }
  1380. },
  1381. series: series
  1382. };
  1383. myChart.setOption(option);
  1384. });
  1385. // 使用刚指定的配置项和数据显示图表。
  1386. //myChart.setOption(option);
  1387. window.addEventListener("resize",function(){
  1388. myChart.resize();
  1389. });
  1390. }
  1391. function char_5() {
  1392. var myChart = echarts.init(document.getElementById('chart_5'));
  1393. option = {
  1394. /*backgroundColor: '#141845',*/
  1395. title: {
  1396. text: '买家人员情况',
  1397. textStyle:{
  1398. color:'#fff',
  1399. },
  1400. x:'center',
  1401. y:'20'
  1402. },
  1403. tooltip: {
  1404. trigger: 'axis',
  1405. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  1406. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  1407. }
  1408. },
  1409. title: [{
  1410. text: '买家人员情况',
  1411. textStyle: {
  1412. color: '#fff',
  1413. fontSize:'20'
  1414. },
  1415. x:'center',
  1416. y:'50'
  1417. },
  1418. {
  1419. text: '性别比例',
  1420. top: '20%',
  1421. left: '4%',
  1422. textStyle: {
  1423. color: '#fff',
  1424. },
  1425. },
  1426. {
  1427. text: '学历分布',
  1428. top: '20%',
  1429. left: '26%',
  1430. textStyle: {
  1431. color: '#fff',
  1432. },
  1433. },
  1434. {
  1435. text: '学历分布',
  1436. top: '20%',
  1437. left: '46%',
  1438. textStyle: {
  1439. color: '#fff',
  1440. },
  1441. },
  1442. {
  1443. text: '年龄分布',
  1444. top: '20%',
  1445. left: '85%',
  1446. textStyle: {
  1447. color: '#fff',
  1448. },
  1449. }
  1450. ],
  1451. legend: [],
  1452. grid: {
  1453. left: '63%',
  1454. top: 'center',
  1455. right: '5%',
  1456. containLabel: true
  1457. },
  1458. xAxis: {
  1459. type: 'value',
  1460. axisLine: {
  1461. lineStyle: {
  1462. color: '#fff'
  1463. }
  1464. },
  1465. },
  1466. yAxis: {
  1467. type: 'category',
  1468. data: ['70后', '80后', '90后', '00后'],
  1469. axisLine: {
  1470. lineStyle: {
  1471. color: "#fff"
  1472. }
  1473. },
  1474. },
  1475. series: [{
  1476. name: '人数',
  1477. type: 'bar',
  1478. data: [190, 520, 290, 20]
  1479. },
  1480. {
  1481. tooltip: {
  1482. trigger: 'item',
  1483. formatter: "{b} : {c} ({d}%)"
  1484. },
  1485. type: 'pie',
  1486. center: ['8%', '50%'],
  1487. radius: ['20%', '39%'],
  1488. avoidLabelOverlap: false,
  1489. label: {
  1490. normal: {
  1491. show: true,
  1492. position: 'inside',
  1493. formatter: '{b},{d}%'
  1494. },
  1495. emphasis: {
  1496. show: true,
  1497. textStyle: {
  1498. fontSize: '20',
  1499. fontWeight: 'bold'
  1500. }
  1501. }
  1502. },
  1503. labelLine: {
  1504. normal: {
  1505. show: false
  1506. }
  1507. },
  1508. data: [{
  1509. value: 189,
  1510. name: '男'
  1511. },
  1512. {
  1513. value: 48,
  1514. name: '女'
  1515. }
  1516. ]
  1517. },
  1518. {
  1519. tooltip: {
  1520. trigger: 'item',
  1521. formatter: "{b} : {c} ({d}%)"
  1522. },
  1523. type: 'pie',
  1524. center: ['30%', '50%'],
  1525. radius: ['20%', '39%'],
  1526. avoidLabelOverlap: false,
  1527. label: {
  1528. normal: {
  1529. show: true,
  1530. position: 'inside',
  1531. formatter: '{b},{d}%'
  1532. },
  1533. emphasis: {
  1534. show: true,
  1535. textStyle: {
  1536. fontSize: '20',
  1537. fontWeight: 'bold'
  1538. }
  1539. }
  1540. },
  1541. labelLine: {
  1542. normal: {
  1543. show: false
  1544. }
  1545. },
  1546. data: [{
  1547. value: 124,
  1548. name: '本科'
  1549. },
  1550. {
  1551. value: 41,
  1552. name: '硕士'
  1553. },
  1554. {
  1555. value: 21,
  1556. name: '博士'
  1557. },
  1558. {
  1559. value: 20,
  1560. name: '其他'
  1561. }
  1562. ]
  1563. },{
  1564. tooltip: {
  1565. trigger: 'item',
  1566. formatter: "{b} : {c} ({d}%)"
  1567. },
  1568. type: 'pie',
  1569. center: ['50%', '50%'],
  1570. radius: ['20%', '39%'],
  1571. avoidLabelOverlap: false,
  1572. label: {
  1573. normal: {
  1574. show: true,
  1575. position: 'inside',
  1576. formatter: '{b},{d}%'
  1577. },
  1578. emphasis: {
  1579. show: true,
  1580. textStyle: {
  1581. fontSize: '20',
  1582. fontWeight: 'bold'
  1583. }
  1584. }
  1585. },
  1586. labelLine: {
  1587. normal: {
  1588. show: false
  1589. }
  1590. },
  1591. data: [{
  1592. value: 124,
  1593. name: '本科'
  1594. },
  1595. {
  1596. value: 41,
  1597. name: '硕士'
  1598. },
  1599. {
  1600. value: 21,
  1601. name: '博士'
  1602. },
  1603. {
  1604. value: 20,
  1605. name: '其他'
  1606. }
  1607. ]
  1608. }
  1609. ]
  1610. };
  1611. // 使用刚指定的配置项和数据显示图表。
  1612. myChart.setOption(option);
  1613. window.addEventListener("resize",function(){
  1614. myChart.resize();
  1615. });
  1616. }
  1617. function char_6() {
  1618. var myChart = echarts.init(document.getElementById('chart_6'));
  1619. let data = [{
  1620. name: "进场",
  1621. list: [{
  1622. date: "周一",
  1623. value: 20
  1624. },
  1625. {
  1626. date: "周二",
  1627. value: 13
  1628. },
  1629. {
  1630. date: "周三",
  1631. value: 15
  1632. },
  1633. {
  1634. date: "周四",
  1635. value: 18
  1636. },
  1637. {
  1638. date: "周五",
  1639. value: 6
  1640. },
  1641. {
  1642. date: "周六",
  1643. value: 11
  1644. },
  1645. {
  1646. date: "周日",
  1647. value: 14
  1648. }
  1649. ]
  1650. },
  1651. {
  1652. name: "进场",
  1653. list: [{
  1654. date: "周一",
  1655. value: 20
  1656. },
  1657. {
  1658. date: "周二",
  1659. value: 13
  1660. },
  1661. {
  1662. date: "周三",
  1663. value: 15
  1664. },
  1665. {
  1666. date: "周四",
  1667. value: 18
  1668. },
  1669. {
  1670. date: "周五",
  1671. value: 6
  1672. },
  1673. {
  1674. date: "周六",
  1675. value: 11
  1676. },
  1677. {
  1678. date: "周日",
  1679. value: 14
  1680. }
  1681. ]
  1682. }
  1683. ];
  1684. let dateList=[];
  1685. let yData1 = [];
  1686. let yData2 = [];
  1687. data[0].list.forEach(function(item,index){
  1688. dateList.push(data[0].list[index].date);
  1689. yData1.push(data[0].list[index].value);
  1690. });
  1691. data[1].list.forEach(function(item,index){
  1692. yData2.push(data[1].list[index].value);
  1693. });
  1694. option = {
  1695. /*backgroundColor: 'rgb(3, 19, 52)',*/
  1696. color: ['#2ea5c3', '#e08f68'],
  1697. tooltip: {
  1698. trigger: 'axis',
  1699. axisPointer: {
  1700. type: 'shadow'
  1701. },
  1702. formatter: function(params) {
  1703. var tiplabel = params[0].name + '<br/>' +
  1704. '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[0].color.colorStops[0].color + '"></span>' +
  1705. params[0].seriesName + ':' + params[0].value + '<br/>' +
  1706. '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[1].color.colorStops[0].color + '"></span>' +
  1707. params[1].seriesName + ':' + params[1].value;
  1708. return tiplabel;
  1709. }
  1710. },
  1711. legend: {
  1712. data: [data[0].name, data[1].name],
  1713. left: 'right',
  1714. icon: "circle",
  1715. textStyle: {
  1716. color: '#fff'
  1717. }
  1718. },
  1719. grid: {
  1720. //top:80,
  1721. left: 20,
  1722. bottom: 20,
  1723. right: 40,
  1724. containLabel: true,
  1725. },
  1726. xAxis: {
  1727. type: 'category',
  1728. data: dateList,
  1729. axisLabel: {
  1730. tooltip: {
  1731. show: true,
  1732. },
  1733. inside: false,
  1734. textStyle: {
  1735. fontSize: 14
  1736. },
  1737. interval: 0,
  1738. color: 'rgba(255,255,255,0.6)'
  1739. },
  1740. axisTick: {
  1741. show: false
  1742. },
  1743. axisLine: {
  1744. lineStyle: {
  1745. color: '#0C1A5B',
  1746. }
  1747. },
  1748. },
  1749. yAxis: [{
  1750. type: 'value',
  1751. splitLine: {
  1752. show: true,
  1753. lineStyle: {
  1754. color: 'rgba(255,255,255,0.1)'
  1755. }
  1756. },
  1757. axisTick: {
  1758. show: false
  1759. },
  1760. axisLine: {
  1761. lineStyle: {
  1762. color: '#0C1A5B',
  1763. }
  1764. },
  1765. axisLabel: {
  1766. textStyle: {
  1767. fontSize: 14
  1768. },
  1769. formatter: function(value) {
  1770. return value
  1771. },
  1772. color: 'rgba(255,255,255,0.6)'
  1773. }
  1774. }],
  1775. series: [{
  1776. name: data[0].name,
  1777. yAxisIndex: 0,
  1778. //barMinHeight:5,
  1779. barCategoryGap: '30%',
  1780. itemStyle: {
  1781. normal: {
  1782. label: {
  1783. show: true,
  1784. position: 'top',
  1785. color: '#fff',
  1786. fontSize: 14,
  1787. },
  1788. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  1789. offset: 0,
  1790. color: '#A43EE5'
  1791. }, {
  1792. offset: 1,
  1793. color: '#CE7C13'
  1794. }]),
  1795. opacity: 1,
  1796. shadowBlur: 5,
  1797. shadowColor: 'rgba(0, 0, 0, 0.5)'
  1798. }
  1799. },
  1800. type: 'bar',
  1801. data: yData1
  1802. },
  1803. {
  1804. name: data[1].name,
  1805. yAxisIndex: 0,
  1806. //barMinHeight:5,
  1807. itemStyle: {
  1808. normal: {
  1809. label: {
  1810. show: true,
  1811. position: 'top',
  1812. color: '#fff',
  1813. fontSize: 14
  1814. },
  1815. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  1816. offset: 0,
  1817. color: '#00FFFF'
  1818. }, {
  1819. offset: 1,
  1820. color: '#004EFF'
  1821. }]),
  1822. opacity: 1,
  1823. shadowBlur: 10,
  1824. shadowColor: 'rgba(0, 0, 0, 0.5)'
  1825. }
  1826. },
  1827. type: 'bar',
  1828. data: yData2
  1829. }
  1830. ]
  1831. }
  1832. // 使用刚指定的配置项和数据显示图表。
  1833. myChart.setOption(option);
  1834. window.addEventListener("resize",function(){
  1835. myChart.resize();
  1836. });
  1837. }
  1838. function char_7() {
  1839. var myChart = echarts.init(document.getElementById('chart_7'));
  1840. var data={
  1841. "title":["标题","单位"],
  1842. "legend":["a","b","c","d","e","f"],
  1843. "data":[[8,30,2825],[9,90,3355],[5,150,2675],[5,210,2495],[6,270,2265],[7,330,1945]]
  1844. }
  1845. option = {
  1846. title: [
  1847. {
  1848. text: data.title[0],
  1849. left: 'center',
  1850. textStyle:{
  1851. color:"#fff"
  1852. }
  1853. },{
  1854. text: data.title[1],
  1855. left: 'center',
  1856. top:'center',
  1857. textStyle:{
  1858. color:"#fff"
  1859. }
  1860. }
  1861. ],
  1862. color: ['#d74e67', '#0092ff', '#eba954', '#21b6b9','#60a900','#01949b',' #f17677'],
  1863. legend: {
  1864. data: data.legend,
  1865. left:'center',
  1866. bottom: 10,
  1867. textStyle: {
  1868. color: '#ffffff'
  1869. },
  1870. },
  1871. polar: {},
  1872. angleAxis: {
  1873. show:false,
  1874. type: 'value',
  1875. min:0,
  1876. max:360
  1877. },
  1878. radiusAxis: {
  1879. show:false,
  1880. axisAngle: 0
  1881. },
  1882. series: []
  1883. };
  1884. for(let i=0;i<3;i++){
  1885. option.series.push({
  1886. type:'pie',
  1887. radius:[20*i+"%",20*(i+1)+"%"],
  1888. silent:true,
  1889. labelLine:{
  1890. normal:{
  1891. show:false
  1892. },
  1893. emphasis:{
  1894. show:false
  1895. }
  1896. },
  1897. itemStyle: {
  1898. normal: {
  1899. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  1900. offset: 0,
  1901. color: '#FFFFFF'
  1902. }, {
  1903. offset: 0.10,
  1904. color: '#FFFFFF'
  1905. }, {
  1906. offset: 0.45,
  1907. color: '#DFDFFF'
  1908. }, {
  1909. offset: 0.55,
  1910. color: '#DFDFFF'
  1911. }, {
  1912. offset: 0.90,
  1913. color: '#FFFFFF'
  1914. },
  1915. {
  1916. offset: 1,
  1917. color: '#FFFFFF'
  1918. }
  1919. ], false),
  1920. }
  1921. },
  1922. data:[{value:100}]
  1923. });
  1924. }
  1925. var size=[];
  1926. for(let i=0;i<data.data.length;i++){
  1927. size.push(data.data[i][2]);
  1928. }
  1929. for(let i=0;i<data.data.length;i++){
  1930. option.series.push({
  1931. name:data.legend[i],
  1932. coordinateSystem: 'polar',
  1933. angleAxisIndex: 0,
  1934. radiusAxisIndex: 0,
  1935. type: 'scatter',
  1936. symbolSize: function(d){
  1937. return d[2]*50/Math.max.apply(Math,size);
  1938. },
  1939. label:{
  1940. normal:{
  1941. show:true,
  1942. }
  1943. },
  1944. data: [data.data[i]]
  1945. })
  1946. }
  1947. setInterval(function () {
  1948. for(var i =0;i<data.data.length;i++){
  1949. data.data[i][1]++;
  1950. if(data.data[i][1]>=360){
  1951. data.data[i][1]=0;
  1952. }
  1953. }
  1954. // console.log(data.data[0][1])
  1955. myChart.setOption(option)
  1956. },100);
  1957. // 使用刚指定的配置项和数据显示图表。
  1958. //myChart.setOption(option);
  1959. window.addEventListener("resize",function(){
  1960. myChart.resize();
  1961. });
  1962. }
  1963. function char_8() {
  1964. var myChart = echarts.init(document.getElementById('chart_8'));
  1965. option = {
  1966. /*backgroundColor: '#2c343c',*/
  1967. title: {
  1968. text: '商品搜索占比',
  1969. left: 'center',
  1970. top: 20,
  1971. textStyle: {
  1972. color: '#ccc'
  1973. }
  1974. },
  1975. tooltip: {
  1976. trigger: 'item',
  1977. formatter: "{b} : {c} ({d}%)"
  1978. },
  1979. visualMap: {
  1980. show: false,
  1981. min: 500,
  1982. max: 600,
  1983. inRange: {
  1984. //colorLightness: [0, 1]
  1985. }
  1986. },
  1987. series: [{
  1988. name: '访问来源',
  1989. type: 'pie',
  1990. radius: '50%',
  1991. center: ['50%', '50%'],
  1992. color: ['rgb(131,249,103)', '#FBFE27', '#FE5050', '#1DB7E5'], //'#FBFE27','rgb(11,228,96)','#FE5050'
  1993. data: [{
  1994. value: 285,
  1995. name: '化妆品'
  1996. },
  1997. {
  1998. value: 410,
  1999. name: '衣服'
  2000. },
  2001. {
  2002. value: 274,
  2003. name: '手机'
  2004. },
  2005. {
  2006. value: 235,
  2007. name: '电脑'
  2008. }
  2009. ].sort(function(a, b) {
  2010. return a.value - b.value
  2011. }),
  2012. roseType: 'radius',
  2013. label: {
  2014. normal: {
  2015. formatter: ['{c|{c}次}', '{b|{b}}'].join('\n'),
  2016. rich: {
  2017. c: {
  2018. color: 'rgb(241,246,104)',
  2019. fontSize: 20,
  2020. fontWeight:'bold',
  2021. lineHeight: 5
  2022. },
  2023. b: {
  2024. color: 'rgb(98,137,169)',
  2025. fontSize: 15,
  2026. height: 40
  2027. },
  2028. },
  2029. }
  2030. },
  2031. labelLine: {
  2032. normal: {
  2033. lineStyle: {
  2034. color: 'rgb(98,137,169)',
  2035. },
  2036. smooth: 0.2,
  2037. length: 10,
  2038. length2: 20,
  2039. }
  2040. },
  2041. itemStyle: {
  2042. normal: {
  2043. shadowColor: 'rgba(0, 0, 0, 0.8)',
  2044. shadowBlur: 50,
  2045. }
  2046. }
  2047. }]
  2048. };
  2049. // 使用刚指定的配置项和数据显示图表。
  2050. myChart.setOption(option);
  2051. window.addEventListener("resize",function(){
  2052. myChart.resize();
  2053. });
  2054. }
  2055. })