123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133 |
- $(function () {
- char_4();
- map();
- Gender();
- char_1();
- char_2();
- char_3();
- /**/
- char_5();
- char_6();
- char_7();
- char_8();
- function map() {
- var myChart = echarts.init(document.getElementById('china'));
- var geoCoordMap = {
- '新疆玛纳斯基地': [86.22, 44.30],
- '九江': [116.00, 29.70],
- '新乡': [116.402217, 35.311657],
- ' ': [79.92, 37.12],
- ' ': [86.85, 47.70],
- '若羌县': [88.17, 39.02],
- '上海': [121.4648, 31.2891],
- '东莞': [113.8953, 22.901],
- '东营': [118.7073, 37.5513],
- '中山': [113.4229, 22.478],
- '临汾': [111.4783, 36.1615],
- '临沂': [118.3118, 35.2936],
- '丹东': [124.541, 40.4242],
- '丽水': [119.5642, 28.1854],
- '乌鲁木齐': [87.9236, 43.5883],
- '佛山': [112.8955, 23.1097],
- '保定': [115.0488, 39.0948],
- '兰州': [103.5901, 36.3043],
- '包头': [110.3467, 41.4899],
- '北京': [116.4551, 40.2539],
- '北海': [109.314, 21.6211],
- '南京': [118.8062, 31.9208],
- '南宁': [108.479, 23.1152],
- '南昌': [116.0046, 28.6633],
- '南通': [121.1023, 32.1625],
- '厦门': [118.1689, 24.6478],
- '台州': [121.1353, 28.6688],
- '合肥': [117.29, 32.0581],
- '呼和浩特': [111.4124, 40.4901],
- '咸阳': [108.4131, 34.8706],
- '哈尔滨': [127.9688, 45.368],
- '唐山': [118.4766, 39.6826],
- '嘉兴': [120.9155, 30.6354],
- '大同': [113.7854, 39.8035],
- '大连': [122.2229, 39.4409],
- '天津': [117.4219, 39.4189],
- '太原': [112.3352, 37.9413],
- '威海': [121.9482, 37.1393],
- '宁波': [121.5967, 29.6466],
- '宝鸡': [107.1826, 34.3433],
- '宿迁': [118.5535, 33.7775],
- '常州': [119.4543, 31.5582],
- '广州': [113.5107, 23.2196],
- '廊坊': [116.521, 39.0509],
- '延安': [109.1052, 36.4252],
- '张家口': [115.1477, 40.8527],
- '徐州': [117.5208, 34.3268],
- '德州': [116.6858, 37.2107],
- '惠州': [114.6204, 23.1647],
- '成都': [103.9526, 30.7617],
- '扬州': [119.4653, 32.8162],
- '承德': [117.5757, 41.4075],
- '拉萨': [91.1865, 30.1465],
- '无锡': [120.3442, 31.5527],
- '日照': [119.2786, 35.5023],
- '昆明': [102.9199, 25.4663],
- '杭州': [119.5313, 29.8773],
- '枣庄': [117.323, 34.8926],
- '柳州': [109.3799, 24.9774],
- '株洲': [113.5327, 27.0319],
- '武汉': [114.3896, 30.6628],
- '汕头': [117.1692, 23.3405],
- '江门': [112.6318, 22.1484],
- '沈阳': [123.1238, 42.1216],
- '沧州': [116.8286, 38.2104],
- '河源': [114.917, 23.9722],
- '泉州': [118.3228, 25.1147],
- '泰安': [117.0264, 36.0516],
- '泰州': [120.0586, 32.5525],
- '济南': [117.1582, 36.8701],
- '济宁': [116.8286, 35.3375],
- '海口': [110.3893, 19.8516],
- '淄博': [118.0371, 36.6064],
- '淮安': [118.927, 33.4039],
- '深圳': [114.5435, 22.5439],
- '清远': [112.9175, 24.3292],
- '温州': [120.498, 27.8119],
- '渭南': [109.7864, 35.0299],
- '湖州': [119.8608, 30.7782],
- '湘潭': [112.5439, 27.7075],
- '滨州': [117.8174, 37.4963],
- '潍坊': [119.0918, 36.524],
- '烟台': [120.7397, 37.5128],
- '玉溪': [101.9312, 23.8898],
- '珠海': [113.7305, 22.1155],
- '盐城': [120.2234, 33.5577],
- '盘锦': [121.9482, 41.0449],
- '石家庄': [114.4995, 38.1006],
- '福州': [119.4543, 25.9222],
- '秦皇岛': [119.2126, 40.0232],
- '绍兴': [120.564, 29.7565],
- '聊城': [115.9167, 36.4032],
- '肇庆': [112.1265, 23.5822],
- '舟山': [122.2559, 30.2234],
- '苏州': [120.6519, 31.3989],
- '莱芜': [117.6526, 36.2714],
- '菏泽': [115.6201, 35.2057],
- '营口': [122.4316, 40.4297],
- '葫芦岛': [120.1575, 40.578],
- '衡水': [115.8838, 37.7161],
- '衢州': [118.6853, 28.8666],
- '西宁': [101.4038, 36.8207],
- '西安': [109.1162, 34.2004],
- '贵阳': [106.6992, 26.7682],
- '连云港': [119.1248, 34.552],
- '邢台': [114.8071, 37.2821],
- '邯郸': [114.4775, 36.535],
- '郑州': [113.4668, 34.6234],
- '鄂尔多斯': [108.9734, 39.2487],
- '重庆': [107.7539, 30.1904],
- '金华': [120.0037, 29.1028],
- '铜川': [109.0393, 35.1947],
- '银川': [106.3586, 38.1775],
- '镇江': [119.4763, 31.9702],
- '长春': [125.8154, 44.2584],
- '长沙': [113.0823, 28.2568],
- '长治': [112.8625, 36.4746],
- '阳泉': [113.4778, 38.0951],
- '青岛': [120.4651, 36.3373],
- '韶关': [113.7964, 24.7028]
- };
- var BJData = [
- [{
- name: '新乡'
- }, {
- name: '新乡',
- value: 200
- }],
- [{
- name: '新乡'
- }, {
- name: '呼和浩特',
- value: 90
- }],
- [{
- name: '新乡'
- }, {
- name: '哈尔滨',
- value: 90
- }],
- [{
- name: '新乡'
- }, {
- name: '石家庄',
- value: 90
- }],
- [{
- name: '新乡'
- }, {
- name: '昆明',
- value: 30
- }],
- [{
- name: '新乡'
- }, {
- name: '北京',
- value: 100
- }],
- [{
- name: '新乡'
- }, {
- name: '长春',
- value: 40
- }],
- [{
- name: '新乡'
- }, {
- name: '重庆',
- value: 40
- }],
- [{
- name: '新乡'
- }, {
- name: '贵阳',
- value: 50
- }],
- [{
- name: '新乡'
- }, {
- name: '南宁',
- value: 30
- }],
- [{
- name: '新乡'
- }, {
- name: '济南',
- value: 10
- }],
- [{
- name: '新乡'
- }, {
- name: '太原',
- value: 40
- }],
- [{
- name: '新乡'
- }, {
- name: '西安',
- value: 60
- }],
- [{
- name: '新乡'
- }, {
- name: '武汉',
- value: 50
- }],
- [{
- name: '新乡'
- }, {
- name: '合肥',
- value: 40
- }],
- [{
- name: '新乡'
- }, {
- name: '南京',
- value: 30
- }],
- [{
- name: '新乡'
- }, {
- name: '沈阳',
- value: 20
- }],
- [{
- name: '新乡'
- }, {
- name: '成都',
- value: 10
- }]
- ];
- var SHData = [
- [{
- name: '九江'
- }, {
- name: '九江',
- value: 200
- }],
- [{
- name: '九江'
- }, {
- name: '长沙',
- value: 95
- }],
- [{
- name: '九江'
- }, {
- name: '武汉',
- value: 30
- }],
- [{
- name: '九江'
- }, {
- name: '南昌',
- value: 20
- }],
- [{
- name: '九江'
- }, {
- name: '合肥',
- value: 70
- }],
- [{
- name: '九江'
- }, {
- name: '南京',
- value: 60
- }],
- [{
- name: '九江'
- }, {
- name: '福州',
- value: 50
- }],
- [{
- name: '九江'
- }, {
- name: '上海',
- value: 100
- }],
- [{
- name: '九江'
- }, {
- name: '深圳',
- value: 100
- }],
- ];
- var GZData = [
- [{
- name: '新疆玛纳斯基地'
- }, {
- name: '新疆玛纳斯基地',
- value: 200
- }],
- [{
- name: '新疆玛纳斯基地'
- }, {
- name: ' ',
- value: 90
- }],
- [{
- name: '新疆玛纳斯基地'
- }, {
- name: ' ',
- value: 40
- }],
- [{
- name: '新疆玛纳斯基地'
- }, {
- name: '呼和浩特',
- value: 90
- }],
- [{
- name: '新疆玛纳斯基地'
- }, {
- name: '昆明',
- value: 40
- }],
- [{
- name: '新疆玛纳斯基地'
- }, {
- name: '成都',
- value: 10
- }],
- [{
- name: '新疆玛纳斯基地'
- }, {
- name: '兰州',
- value: 95
- }],
- [{
- name: '新疆玛纳斯基地'
- }, {
- name: '银川',
- value: 90
- }],
- [{
- name: '新疆玛纳斯基地'
- }, {
- name: '西宁',
- value: 80
- }],
- ];
- 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';
- var convertData = function(data) {
- var res = [];
- for (var i = 0; i < data.length; i++) {
- var dataItem = data[i];
- var fromCoord = geoCoordMap[dataItem[0].name];
- var toCoord = geoCoordMap[dataItem[1].name];
- if (fromCoord && toCoord) {
- res.push([{
- coord: fromCoord
- }, {
- coord: toCoord
- }]);
- }
- }
- return res;
- };
- var color = ['#3ed4ff', '#ffa022', '#a6c84c'];
- var series = [];
- [
- ['新乡', BJData],
- ['九江', SHData],
- ['新疆', GZData]
- ].forEach(function(item, i) {
- series.push({
- name: item[0] + ' Top10',
- type: 'lines',
- zlevel: 1,
- effect: {
- show: true,
- period: 6,
- trailLength: 0.7,
- color: '#fff',
- symbolSize: 3
- },
- lineStyle: {
- normal: {
- color: color[i],
- width: 0,
- curveness: 0.2
- }
- },
- data: convertData(item[1])
- }, {
- name: item[0] + ' Top10',
- type: 'lines',
- zlevel: 2,
- effect: {
- show: true,
- period: 6,
- trailLength: 0,
- symbol: planePath,
- symbolSize: 15
- },
- lineStyle: {
- normal: {
- color: color[i],
- width: 1,
- opacity: 0.4,
- curveness: 0.2
- }
- },
- data: convertData(item[1])
- }, {
- name: item[0] + ' Top10',
- type: 'effectScatter',
- coordinateSystem: 'geo',
- zlevel: 2,
- rippleEffect: {
- brushType: 'stroke'
- },
- label: {
- normal: {
- show: true,
- position: 'right',
- formatter: '{b}'
- }
- },
- symbolSize: function(val) {
- return val[2] / 8;
- },
- itemStyle: {
- normal: {
- color: color[i]
- }
- },
- data: item[1].map(function(dataItem) {
- return {
- name: dataItem[1].name,
- value: geoCoordMap[dataItem[1].name].concat([dataItem[1].value])
- };
- })
- });
- });
- option = {
- /*backgroundColor: '#080a20',*/
- title: {
- text: '物流情况',
- subtext: '',
- left: 'left',
- textStyle: {
- color: '#fff'
- }
- },
- tooltip: {
- trigger: 'item'
- },
- legend: {
- orient: 'vertical',
- top: 'bottom',
- left: 'right',
- data: ['北京 Top10', '上海 Top10', '广州 Top10'],
- textStyle: {
- color: '#fff'
- },
- selectedMode: 'single'
- },
- geo: {
- map: 'china',
- label: {
- emphasis: {
- show: false
- }
- },
- roam: true,
- itemStyle: {
- normal: {
- areaColor: '#132937',
- borderColor: '#0692a4'
- },
- emphasis: {
- areaColor: '#0b1c2d'
- }
- }
- },
- series: series
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize",function(){
- myChart.resize();
- });
- }
- function Gender() {
- var myChart = echarts.init(document.getElementById('Gender'));
- var symbols = [
- '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',
- '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',
- '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'
- ];
- var bodyMax = 100; //指定图形界限的值
- var labelSetting = {
- normal: {
- show: true,
- position: 'bottom',
- offset: [0, 10],
- formatter: function(param) {
- return (param.value / bodyMax * 100).toFixed(0) + '%';
- },
- textStyle: {
- fontSize: 18,
- fontFamily: 'Arial',
- color: '#ffffff'
- }
- }
- };
- var markLineSetting = { //设置标线
- symbol: 'none',
- lineStyle: {
- normal: {
- opacity: 0.3
- }
- },
- data: [{
- type: 'max',
- label: {
- normal: {
- formatter: 'max: {c}'
- }
- }
- }, {
- type: 'min',
- label: {
- normal: {
- formatter: 'min: {c}'
- }
- }
- }]
- };
- option = {
- tooltip: {
- show: false, //鼠标放上去显示悬浮数据
- },
- legend: {
- data: ['男性', '女性'],
- selectedMode: 'single',
- itemWidth: 10, //图例的宽度
- itemHeight: 10, //图例的高度
- itemGap: 30,
- orient: 'horizontal',
- left: 'center',
- top: '20px',
- icon: 'rect',
- // selectedMode: false, //取消图例上的点击事件
- textStyle: {
- color: '#ffffff'
- },
- },
- grid: {
- // left: '20%',
- // right: '20%',
- top: '20%',
- bottom: '20%',
- containLabel: true
- },
- xAxis: {
- data: ['a', 'x', 'b'],
- axisTick: {
- show: false
- },
- axisLine: {
- show: false
- },
- axisLabel: {
- show: false
- }
- },
- yAxis: {
- max: bodyMax,
- splitLine: {
- show: false
- },
- axisTick: {
- // 刻度线
- show: false
- },
- axisLine: {
- // 轴线
- show: false
- },
- axisLabel: {
- // 轴坐标文字
- show: false
- }
- },
- series: [{
- name: '男性',
- type: 'pictorialBar',
- symbolClip: true,
- symbolBoundingData: bodyMax,
- label: labelSetting,
- data: [{
- value: 35,
- symbol: symbols[0],
- itemStyle: {
- normal: {
- color: 'rgba(105,204,230)' //单独控制颜色
- }
- },
- },
- {
- },
- {
- value: 65,
- symbol: symbols[1],
- itemStyle: {
- normal: {
- color: 'rgba(255,130,130)' //单独控制颜色
- }
- },
- }
- ],
- // markLine: markLineSetting,
- z: 10
- },
- {
- name: '女性',
- type: 'pictorialBar',
- symbolClip: true,
- symbolBoundingData: bodyMax,
- label: labelSetting,
- data: [{
- value: 70,
- symbol: symbols[0]
- },
- {},
- {
- value: 30,
- symbol: symbols[1]
- }
- ],
- // markLine: markLineSetting,
- z: 10
- },
- {
- // 设置背景底色,不同的情况用这个
- name: 'full',
- type: 'pictorialBar', //异型柱状图 图片、SVG PathData
- symbolBoundingData: bodyMax,
- animationDuration: 0,
- itemStyle: {
- normal: {
- color: '#ccc' //设置全部颜色,统一设置
- }
- },
- z: 10,
- data: [{
- itemStyle: {
- normal: {
- color: 'rgba(105,204,230,0.40)' //单独控制颜色
- }
- },
- value: 100,
- symbol: symbols[0]
- },
- {
- // 设置中间冒号
- itemStyle: {
- normal: {
- color: '#1DA1F2' //单独控制颜色
- }
- },
- value: 100,
- symbol: symbols[2],
- symbolSize: [8, '18%'],
- symbolOffset: [0, '-200%']
- },
- {
- itemStyle: {
- normal: {
- color: 'rgba(255,130,130,0.40)' //单独控制颜色
- }
- },
- value: 100,
- symbol: symbols[1]
- }
- ]
- }
- ]
- }
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize",function(){
- myChart.resize();
- });
- }
- function char_1() {
- var myChart = echarts.init(document.getElementById('char_1'));
- var myColor = ['#eb2100', '#eb3600', '#d0570e', '#d0a00e', '#34da62', '#00e9db', '#00c0e9', '#0096f3', '#33CCFF', '#33FFCC'];
- option = {
- /*backgroundColor: '#0e2147',*/
- grid: {
- left: '11%',
- top: '12%',
- right: '0%',
- bottom: '8%',
- containLabel: true
- },
- xAxis: [{
- show: false,
- }],
- yAxis: [{
- axisTick: 'none',
- axisLine: 'none',
- offset: '27',
- axisLabel: {
- textStyle: {
- color: '#ffffff',
- fontSize: '16',
- }
- },
- /*data: ['南昌转运中心', '广州转运中心', '杭州转运中心', '宁夏转运中心', '兰州转运中心', '南宁转运中心', '长沙转运中心', '武汉转运中心', '合肥转运中心', '贵州转运中心']*/
- data: ['兰州转运中心', '南宁转运中心', '长沙转运中心', '武汉转运中心', '合肥转运中心', '贵州转运中心']
- }, {
- axisTick: 'none',
- axisLine: 'none',
- axisLabel: {
- textStyle: {
- color: '#ffffff',
- fontSize: '14',
- }
- },
- data: ['6', '5', '4', '3', '2', '1']
- }, {
- name: '分拨延误TOP 10',
- nameGap: '50',
- nameTextStyle: {
- color: '#ffffff',
- fontSize: '14',
- },
- axisLine: {
- lineStyle: {
- color: 'rgba(0,0,0,0)'
- }
- },
- data: [],
- }],
- series: [{
- name: '条',
- type: 'bar',
- yAxisIndex: 0,
- data: [ 38, 44, 50, 52, 60, 72],
- label: {
- normal: {
- show: true,
- position: 'right',
- textStyle: {
- color: '#ffffff',
- fontSize: '10',
- }
- }
- },
- barWidth: 5,
- itemStyle: {
- normal: {
- color: function(params) {
- var num = myColor.length;
- return myColor[params.dataIndex % num]
- },
- }
- },
- z: 2
- }, {
- name: '白框',
- type: 'bar',
- yAxisIndex: 1,
- barGap: '-100%',
- data: [99.5, 99.5, 99.5, 99.5, 99.5, 99.5],
- barWidth: 5,
- itemStyle: {
- normal: {
- color: '#0e2147',
- barBorderRadius: 5,
- }
- },
- z: 1
- }, {
- name: '外框',
- type: 'bar',
- yAxisIndex: 2,
- barGap: '-100%',
- data: [100, 100, 100, 100, 100, 100],
- barWidth: 12,
- itemStyle: {
- normal: {
- color: function(params) {
- var num = myColor.length;
- return myColor[params.dataIndex % num]
- },
- barBorderRadius: 5,
- }
- },
- z: 0
- },
- {
- name: '外圆',
- type: 'scatter',
- hoverAnimation: false,
- data: [ 0, 0, 0, 0, 0, 0],
- yAxisIndex: 2,
- symbolSize: 15,
- itemStyle: {
- normal: {
- color: function(params) {
- var num = myColor.length;
- return myColor[params.dataIndex % num]
- },
- opacity: 1,
- }
- },
- z: 2
- }
- ]
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize",function(){
- myChart.resize();
- });
- }
- function char_2() {
- var myChart = echarts.init(document.getElementById('char_2'));
- var myColor = ['#eb2100', '#eb3600', '#d0570e', '#d0a00e', '#34da62', '#00e9db', '#00c0e9', '#0096f3', '#33CCFF', '#33FFCC'];
- option = {
- /*backgroundColor: '#0e2147',*/
- grid: {
- left: '11%',
- top: '12%',
- right: '0%',
- bottom: '8%',
- containLabel: true
- },
- xAxis: [{
- show: false,
- }],
- yAxis: [{
- axisTick: 'none',
- axisLine: 'none',
- offset: '27',
- axisLabel: {
- textStyle: {
- color: '#ffffff',
- fontSize: '16',
- }
- },
- /*data: ['南昌转运中心', '广州转运中心', '杭州转运中心', '宁夏转运中心', '兰州转运中心', '南宁转运中心', '长沙转运中心', '武汉转运中心', '合肥转运中心', '贵州转运中心']*/
- data: ['兰州转运中心', '南宁转运中心', '长沙转运中心', '武汉转运中心', '合肥转运中心', '贵州转运中心']
- }, {
- axisTick: 'none',
- axisLine: 'none',
- axisLabel: {
- textStyle: {
- color: '#ffffff',
- fontSize: '14',
- }
- },
- data: ['6', '5', '4', '3', '2', '1']
- }, {
- name: '分拨延误TOP 10',
- nameGap: '50',
- nameTextStyle: {
- color: '#ffffff',
- fontSize: '14',
- },
- axisLine: {
- lineStyle: {
- color: 'rgba(0,0,0,0)'
- }
- },
- data: [],
- }],
- series: [{
- name: '条',
- type: 'bar',
- yAxisIndex: 0,
- data: [ 8, 14, 20, 32, 35, 42],
- label: {
- normal: {
- show: true,
- position: 'right',
- textStyle: {
- color: '#ffffff',
- fontSize: '10',
- }
- }
- },
- barWidth: 10,
- itemStyle: {
- normal: {
- color: function(params) {
- var num = myColor.length;
- return myColor[params.dataIndex % num]
- },
- }
- },
- z: 2
- }, {
- name: '白框',
- type: 'bar',
- yAxisIndex: 1,
- barGap: '-50%',
- data: [50,50,50,50,50,50],
- barWidth: 10,
- itemStyle: {
- normal: {
- color: '#0e2147',
- barBorderRadius: 5,
- }
- },
- z: 1
- }, {
- name: '外框',
- type: 'bar',
- yAxisIndex: 2,
- barGap: '-500%',
- data: [50,50,50,50,50,50],
- barWidth: 12,
- itemStyle: {
- normal: {
- color: function(params) {
- var num = myColor.length;
- return myColor[params.dataIndex % num]
- },
- barBorderRadius: 5,
- }
- },
- z: 0
- },
- {
- name: '外圆',
- type: 'scatter',
- hoverAnimation: false,
- data: [ 0, 0, 0, 0, 0, 0],
- yAxisIndex: 2,
- symbolSize: 15,
- itemStyle: {
- normal: {
- color: function(params) {
- var num = myColor.length;
- return myColor[params.dataIndex % num]
- },
- opacity: 1,
- }
- },
- z: 2
- }
- ]
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize",function(){
- myChart.resize();
- });
- }
- function char_3() {
- var myChart = echarts.init(document.getElementById('chart_3'));
- let seriesLineData = []
- let LineData = [{
- name: '破损件',
- 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],
- color: ['#2773fa', '#051f48']
- },
- {
- name: '丢失件',
- 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],
- color: ['#14c3fc', '#022536']
- },
- {
- name: '损坏件',
- 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],
- color: ['#5deefe', '#01323a']
- },
- {
- name: '拒收件',
- 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],
- color: ['#fff369', '#353910']
- },
- {
- name: '未签收',
- 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],
- color: ['#ffaf48', '#0f1e21']
- }
- ];
- for (var i = 0; i < LineData.length; i++) {
- seriesLineData.push({
- name: LineData[i].name,
- type: 'line',
- smooth: true,
- symbol: "none", //去掉折线点
- stack: i, //数据区叠加 问题
- symbolSize: 5, //折线点的大小
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: LineData[i].color[1]
- }, {
- offset: 0.8,
- color: LineData[i].color[1]
- },
- {
- offset: 1,
- color: '#0f1e21' // 100% 处的颜色
- }
- ], false),
- }
- },
- itemStyle: {
- normal: {
- color: LineData[i].color[0],
- borderColor: LineData[i].color[0],
- borderWidth: 12
- }
- },
- data: LineData[i].data,
- })
- }
- option = {
- /*backgroundColor: '#02121e',*/
- title: {
- text: '单位 / 件',
- textStyle: {
- fontSize: 12,
- fontWeight: 'normal',
- color: '#c7cbcd' //标题颜色
- },
- left: '2%',
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- label: {
- backgroundColor: '#6a7985'
- },
- }
- },
- legend: {
- icon: "roundRect",
- orient: 'horizontal', //图例朝向
- // data: ['空闲', '训练事件'],
- textStyle: {
- fontSize: 12, //字体大小
- color: '#c7cbcd', //字体颜色
- },
- itemWidth: 10,
- itemHeight: 5,
- right: '3%' //距离右侧
- },
- grid: {
- left: '3%',
- top: '5%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- data: ['广州', '浙江', '上海', '福建', '江西', '安徽', '湖南', '湖北', '河南', '河北', '北京', '山西', '陕西', '贵州', '云南', '广西', '重庆', '四川', '内蒙', '辽宁', '黑龙江', '江西', '山东', '吉林', '青海', '海南', '宁夏', '天津'],
- axisLabel: {
- interval:0,
- rotate:40,//倾斜角度
- show: true,
- textStyle: {
- color: '#c7cbcd'
- }
- },
- axisLine: {
- lineStyle: {
- color: '#0a2b52',
- width: 0.5, //这里是为了突出显示加上的
- }
- }
- }],
- yAxis: [{
- type: 'value',
- // splitNumber : 10,
- interval: 10, //坐标抽分割间隔
- axisLine: {
- onZero: false,
- lineStyle: {
- color: '#0a2b52',
- width: 1, //这里是为了突出显示加上的
- }
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: '#c7cbcd' //字体颜色
- }
- },
- splitLine: { //保留网格线
- show: true,
- lineStyle: { //y轴网格线设置
- color: '#0a2b52',
- width: 1,
- type: 'dashed'
- }
- },
- }],
- series: seriesLineData
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize",function(){
- myChart.resize();
- });
- }
- function char_4() {
- var myChart = echarts.init(document.getElementById('maps'));
- //var uploadedDataURL = "./js/data-1519279347346-BkslpCjwf.json";
- var uploadedDataURL = "./js/data-1576140623415-kSH4vRQ1.json";
- $.getJSON(uploadedDataURL, function(geoJson) {
- echarts.registerMap('jiangxi', geoJson);
- var chinaGeoCoordMap = {
- "合肥市": [117.29, 32.0581],
- "亳州市": [116.1914, 33.4698],
- "六安市": [116.3123, 31.8329],
- "安庆市": [116.7517, 30.5255],
- "宣城市": [118.8062, 30.6244],
- "宿州市": [117.5208, 33.6841],
- "池州市": [117.3889, 30.2014],
- "淮北市": [116.6968, 33.6896],
- "淮南市": [116.7847, 32.7722],
- "滁州市": [118.1909, 32.536],
- "芜湖市": [118.3557, 31.0858],
- "蚌埠市": [117.4109, 33.1073],
- "铜陵市": [117.9382, 30.9375],
- "阜阳市": [115.7629, 32.9919],
- "马鞍山市": [118.6304, 31.5363],
- "黄山市": [118.0481, 29.9542]
- };
- var chinaDatas = [
- [{
- name: '合肥市',
- value: 0
- }],
- [{
- name: '亳州市',
- value: 0
- }],
- [{
- name: '六安市',
- value: 0
- }],
- [{
- name: '安庆市',
- value: 0
- }],
- [{
- name: '宣城市',
- value: 0
- }],
- [{
- name: '宿州市',
- value: 0
- }],
- [{
- name: '池州市',
- value: 0
- }],
- [{
- name: '淮北市',
- value: 0
- }],
- [{
- name: '淮南市',
- value: 0
- }],
- [{
- name: '滁州市',
- value: 0
- }],
- [{
- name: '芜湖市',
- value: 0
- }],
- [{
- name: '蚌埠市',
- value: 0
- }],
- [{
- name: '铜陵市',
- value: 0
- }],
- [{
- name: '阜阳市',
- value: 0
- }],
- [{
- name: '马鞍山市',
- value: 0
- }],
- [{
- name: '黄山市',
- value: 0
- }]
- ];
- var convertData = function(data) {
- var res = [];
- for (var i = 0; i < data.length; i++) {
- var dataItem = data[i];
- var fromCoord = chinaGeoCoordMap[dataItem[0].name];
- var toCoord = [117.29, 32.0581];
- if (fromCoord && toCoord) {
- res.push([{
- coord: fromCoord,
- value: dataItem[0].value
- }, {
- coord: toCoord,
- }]);
- }
- }
- return res;
- };
- var series = [];
- [['合肥市', chinaDatas]].forEach(function(item, i) {
- console.log(item)
- series.push({
- type: 'lines',
- zlevel: 2,
- effect: {
- show: true,
- period: 4, //箭头指向速度,值越小速度越快
- trailLength: 0.02, //特效尾迹长度[0,1]值越大,尾迹越长重
- symbol: 'arrow', //箭头图标
- symbolSize: 5, //图标大小
- },
- lineStyle: {
- normal: {
- width: 1, //尾迹线条宽度
- opacity: 1, //尾迹线条透明度
- curveness: .3 //尾迹线条曲直度
- }
- },
- data: convertData(item[1])
- }, {
- type: 'effectScatter',
- coordinateSystem: 'geo',
- zlevel: 2,
- rippleEffect: { //涟漪特效
- period: 4, //动画时间,值越小速度越快
- brushType: 'stroke', //波纹绘制方式 stroke, fill
- scale: 4 //波纹圆环最大限制,值越大波纹越大
- },
- label: {
- normal: {
- show: true,
- position: 'right', //显示位置
- offset: [5, 0], //偏移设置
- formatter: function(params) { //圆环显示文字
- return params.data.name;
- },
- fontSize: 13
- },
- emphasis: {
- show: true
- }
- },
- symbol: 'circle',
- symbolSize: function(val) {
- return 5 + val[2] * 5; //圆环大小
- },
- itemStyle: {
- normal: {
- show: false,
- color: '#f00'
- }
- },
- data: item[1].map(function(dataItem) {
- return {
- name: dataItem[0].name,
- value: chinaGeoCoordMap[dataItem[0].name].concat([dataItem[0].value])
- };
- }),
- },
- //被攻击点
- {
- type: 'scatter',
- coordinateSystem: 'geo',
- zlevel: 2,
- rippleEffect: {
- period: 4,
- brushType: 'stroke',
- scale: 4
- },
- label: {
- normal: {
- show: true,
- position: 'right',
- //offset:[5, 0],
- color: '#0f0',
- formatter: '{b}',
- textStyle: {
- color: "#0f0"
- }
- },
- emphasis: {
- show: true,
- color: "#f60"
- }
- },
- symbol: 'pin',
- symbolSize: 50,
- data: [{
- name: item[0],
- value: chinaGeoCoordMap[item[0]].concat([10]),
- }],
- }
- );
- });
- option = {
- tooltip: {
- trigger: 'item',
- backgroundColor: 'rgba(166, 200, 76, 0.82)',
- borderColor: '#FFFFCC',
- showDelay: 0,
- hideDelay: 0,
- enterable: true,
- transitionDuration: 0,
- extraCssText: 'z-index:100',
- formatter: function(params, ticket, callback) {
- //根据业务自己拓展要显示的内容
- var res = "";
- var name = params.name;
- var value = params.value[params.seriesIndex + 1];
- res = "<span style='color:#fff;'>" + name + "</span><br/>数据:" + value;
- return res;
- }
- },
- /*backgroundColor: "#013954",*/
- visualMap: { //图例值控制
- min: 0,
- max: 1,
- calculable: true,
- show: true,
- color: ['#f44336', '#fc9700', '#ffde00', '#ffde00', '#00eaff'],
- textStyle: {
- color: '#fff'
- }
- },
- geo: {
- map: 'jiangxi',
- zoom: 1.2,
- label: {
- emphasis: {
- show: false
- }
- },
- roam: true, //是否允许缩放
- itemStyle: {
- normal: {
- color: 'rgba(51, 69, 89, .5)', //地图背景色
- borderColor: '#516a89', //省市边界线00fcff 516a89
- borderWidth: 1
- },
- emphasis: {
- color: 'rgba(37, 43, 61, .5)' //悬浮背景
- }
- }
- },
- series: series
- };
- myChart.setOption(option);
- });
- // 使用刚指定的配置项和数据显示图表。
- //myChart.setOption(option);
- window.addEventListener("resize",function(){
- myChart.resize();
- });
- }
- function char_5() {
- var myChart = echarts.init(document.getElementById('chart_5'));
- option = {
- /*backgroundColor: '#141845',*/
- title: {
- text: '买家人员情况',
- textStyle:{
- color:'#fff',
- },
- x:'center',
- y:'20'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
- type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- }
- },
- title: [{
- text: '买家人员情况',
- textStyle: {
- color: '#fff',
- fontSize:'20'
- },
- x:'center',
- y:'50'
- },
- {
- text: '性别比例',
- top: '20%',
- left: '4%',
- textStyle: {
- color: '#fff',
- },
- },
- {
- text: '学历分布',
- top: '20%',
- left: '26%',
- textStyle: {
- color: '#fff',
- },
- },
- {
- text: '学历分布',
- top: '20%',
- left: '46%',
- textStyle: {
- color: '#fff',
- },
- },
- {
- text: '年龄分布',
- top: '20%',
- left: '85%',
- textStyle: {
- color: '#fff',
- },
- }
- ],
- legend: [],
- grid: {
- left: '63%',
- top: 'center',
- right: '5%',
- containLabel: true
- },
- xAxis: {
- type: 'value',
- axisLine: {
- lineStyle: {
- color: '#fff'
- }
- },
- },
- yAxis: {
- type: 'category',
- data: ['70后', '80后', '90后', '00后'],
- axisLine: {
- lineStyle: {
- color: "#fff"
- }
- },
- },
- series: [{
- name: '人数',
- type: 'bar',
- data: [190, 520, 290, 20]
- },
- {
- tooltip: {
- trigger: 'item',
- formatter: "{b} : {c} ({d}%)"
- },
- type: 'pie',
- center: ['8%', '50%'],
- radius: ['20%', '39%'],
- avoidLabelOverlap: false,
- label: {
- normal: {
- show: true,
- position: 'inside',
- formatter: '{b},{d}%'
- },
- emphasis: {
- show: true,
- textStyle: {
- fontSize: '20',
- fontWeight: 'bold'
- }
- }
- },
- labelLine: {
- normal: {
- show: false
- }
- },
- data: [{
- value: 189,
- name: '男'
- },
- {
- value: 48,
- name: '女'
- }
- ]
- },
- {
- tooltip: {
- trigger: 'item',
- formatter: "{b} : {c} ({d}%)"
- },
- type: 'pie',
- center: ['30%', '50%'],
- radius: ['20%', '39%'],
- avoidLabelOverlap: false,
- label: {
- normal: {
- show: true,
- position: 'inside',
- formatter: '{b},{d}%'
- },
- emphasis: {
- show: true,
- textStyle: {
- fontSize: '20',
- fontWeight: 'bold'
- }
- }
- },
- labelLine: {
- normal: {
- show: false
- }
- },
- data: [{
- value: 124,
- name: '本科'
- },
- {
- value: 41,
- name: '硕士'
- },
- {
- value: 21,
- name: '博士'
- },
- {
- value: 20,
- name: '其他'
- }
- ]
- },{
- tooltip: {
- trigger: 'item',
- formatter: "{b} : {c} ({d}%)"
- },
- type: 'pie',
- center: ['50%', '50%'],
- radius: ['20%', '39%'],
- avoidLabelOverlap: false,
- label: {
- normal: {
- show: true,
- position: 'inside',
- formatter: '{b},{d}%'
- },
- emphasis: {
- show: true,
- textStyle: {
- fontSize: '20',
- fontWeight: 'bold'
- }
- }
- },
- labelLine: {
- normal: {
- show: false
- }
- },
- data: [{
- value: 124,
- name: '本科'
- },
- {
- value: 41,
- name: '硕士'
- },
- {
- value: 21,
- name: '博士'
- },
- {
- value: 20,
- name: '其他'
- }
- ]
- }
- ]
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize",function(){
- myChart.resize();
- });
- }
- function char_6() {
- var myChart = echarts.init(document.getElementById('chart_6'));
- let data = [{
- name: "进场",
- list: [{
- date: "周一",
- value: 20
- },
- {
- date: "周二",
- value: 13
- },
- {
- date: "周三",
- value: 15
- },
- {
- date: "周四",
- value: 18
- },
- {
- date: "周五",
- value: 6
- },
- {
- date: "周六",
- value: 11
- },
- {
- date: "周日",
- value: 14
- }
- ]
- },
- {
- name: "进场",
- list: [{
- date: "周一",
- value: 20
- },
- {
- date: "周二",
- value: 13
- },
- {
- date: "周三",
- value: 15
- },
- {
- date: "周四",
- value: 18
- },
- {
- date: "周五",
- value: 6
- },
- {
- date: "周六",
- value: 11
- },
- {
- date: "周日",
- value: 14
- }
- ]
- }
- ];
- let dateList=[];
- let yData1 = [];
- let yData2 = [];
- data[0].list.forEach(function(item,index){
- dateList.push(data[0].list[index].date);
- yData1.push(data[0].list[index].value);
- });
- data[1].list.forEach(function(item,index){
- yData2.push(data[1].list[index].value);
- });
- option = {
- /*backgroundColor: 'rgb(3, 19, 52)',*/
- color: ['#2ea5c3', '#e08f68'],
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- },
- formatter: function(params) {
- var tiplabel = params[0].name + '<br/>' +
- '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[0].color.colorStops[0].color + '"></span>' +
- params[0].seriesName + ':' + params[0].value + '<br/>' +
- '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[1].color.colorStops[0].color + '"></span>' +
- params[1].seriesName + ':' + params[1].value;
- return tiplabel;
- }
- },
- legend: {
- data: [data[0].name, data[1].name],
- left: 'right',
- icon: "circle",
- textStyle: {
- color: '#fff'
- }
- },
- grid: {
- //top:80,
- left: 20,
- bottom: 20,
- right: 40,
- containLabel: true,
- },
- xAxis: {
- type: 'category',
- data: dateList,
- axisLabel: {
- tooltip: {
- show: true,
- },
- inside: false,
- textStyle: {
- fontSize: 14
- },
- interval: 0,
- color: 'rgba(255,255,255,0.6)'
- },
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#0C1A5B',
- }
- },
- },
- yAxis: [{
- type: 'value',
- splitLine: {
- show: true,
- lineStyle: {
- color: 'rgba(255,255,255,0.1)'
- }
- },
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#0C1A5B',
- }
- },
- axisLabel: {
- textStyle: {
- fontSize: 14
- },
- formatter: function(value) {
- return value
- },
- color: 'rgba(255,255,255,0.6)'
- }
- }],
- series: [{
- name: data[0].name,
- yAxisIndex: 0,
- //barMinHeight:5,
- barCategoryGap: '30%',
- itemStyle: {
- normal: {
- label: {
- show: true,
- position: 'top',
- color: '#fff',
- fontSize: 14,
- },
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: '#A43EE5'
- }, {
- offset: 1,
- color: '#CE7C13'
- }]),
- opacity: 1,
- shadowBlur: 5,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- },
- type: 'bar',
- data: yData1
- },
- {
- name: data[1].name,
- yAxisIndex: 0,
- //barMinHeight:5,
- itemStyle: {
- normal: {
- label: {
- show: true,
- position: 'top',
- color: '#fff',
- fontSize: 14
- },
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: '#00FFFF'
- }, {
- offset: 1,
- color: '#004EFF'
- }]),
- opacity: 1,
- shadowBlur: 10,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- },
- type: 'bar',
- data: yData2
- }
- ]
- }
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize",function(){
- myChart.resize();
- });
- }
- function char_7() {
- var myChart = echarts.init(document.getElementById('chart_7'));
- var data={
- "title":["标题","单位"],
- "legend":["a","b","c","d","e","f"],
- "data":[[8,30,2825],[9,90,3355],[5,150,2675],[5,210,2495],[6,270,2265],[7,330,1945]]
- }
- option = {
- title: [
- {
- text: data.title[0],
- left: 'center',
- textStyle:{
- color:"#fff"
- }
- },{
- text: data.title[1],
- left: 'center',
- top:'center',
- textStyle:{
- color:"#fff"
- }
- }
- ],
- color: ['#d74e67', '#0092ff', '#eba954', '#21b6b9','#60a900','#01949b',' #f17677'],
- legend: {
- data: data.legend,
- left:'center',
- bottom: 10,
- textStyle: {
- color: '#ffffff'
- },
- },
- polar: {},
- angleAxis: {
- show:false,
- type: 'value',
- min:0,
- max:360
- },
- radiusAxis: {
- show:false,
- axisAngle: 0
- },
- series: []
- };
- for(let i=0;i<3;i++){
- option.series.push({
- type:'pie',
- radius:[20*i+"%",20*(i+1)+"%"],
- silent:true,
- labelLine:{
- normal:{
- show:false
- },
- emphasis:{
- show:false
- }
- },
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: '#FFFFFF'
- }, {
- offset: 0.10,
- color: '#FFFFFF'
- }, {
- offset: 0.45,
- color: '#DFDFFF'
- }, {
- offset: 0.55,
- color: '#DFDFFF'
- }, {
- offset: 0.90,
- color: '#FFFFFF'
- },
- {
- offset: 1,
- color: '#FFFFFF'
- }
- ], false),
- }
- },
- data:[{value:100}]
- });
- }
- var size=[];
- for(let i=0;i<data.data.length;i++){
- size.push(data.data[i][2]);
- }
- for(let i=0;i<data.data.length;i++){
- option.series.push({
- name:data.legend[i],
- coordinateSystem: 'polar',
- angleAxisIndex: 0,
- radiusAxisIndex: 0,
- type: 'scatter',
- symbolSize: function(d){
- return d[2]*50/Math.max.apply(Math,size);
- },
- label:{
- normal:{
- show:true,
- }
- },
- data: [data.data[i]]
- })
- }
- setInterval(function () {
- for(var i =0;i<data.data.length;i++){
- data.data[i][1]++;
- if(data.data[i][1]>=360){
- data.data[i][1]=0;
- }
- }
- // console.log(data.data[0][1])
- myChart.setOption(option)
- },100);
- // 使用刚指定的配置项和数据显示图表。
- //myChart.setOption(option);
- window.addEventListener("resize",function(){
- myChart.resize();
- });
- }
- function char_8() {
- var myChart = echarts.init(document.getElementById('chart_8'));
- option = {
- /*backgroundColor: '#2c343c',*/
- title: {
- text: '商品搜索占比',
- left: 'center',
- top: 20,
- textStyle: {
- color: '#ccc'
- }
- },
- tooltip: {
- trigger: 'item',
- formatter: "{b} : {c} ({d}%)"
- },
- visualMap: {
- show: false,
- min: 500,
- max: 600,
- inRange: {
- //colorLightness: [0, 1]
- }
- },
- series: [{
- name: '访问来源',
- type: 'pie',
- radius: '50%',
- center: ['50%', '50%'],
- color: ['rgb(131,249,103)', '#FBFE27', '#FE5050', '#1DB7E5'], //'#FBFE27','rgb(11,228,96)','#FE5050'
- data: [{
- value: 285,
- name: '化妆品'
- },
- {
- value: 410,
- name: '衣服'
- },
- {
- value: 274,
- name: '手机'
- },
- {
- value: 235,
- name: '电脑'
- }
- ].sort(function(a, b) {
- return a.value - b.value
- }),
- roseType: 'radius',
- label: {
- normal: {
- formatter: ['{c|{c}次}', '{b|{b}}'].join('\n'),
- rich: {
- c: {
- color: 'rgb(241,246,104)',
- fontSize: 20,
- fontWeight:'bold',
- lineHeight: 5
- },
- b: {
- color: 'rgb(98,137,169)',
- fontSize: 15,
- height: 40
- },
- },
- }
- },
- labelLine: {
- normal: {
- lineStyle: {
- color: 'rgb(98,137,169)',
- },
- smooth: 0.2,
- length: 10,
- length2: 20,
- }
- },
- itemStyle: {
- normal: {
- shadowColor: 'rgba(0, 0, 0, 0.8)',
- shadowBlur: 50,
- }
- }
- }]
- };
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(option);
- window.addEventListener("resize",function(){
- myChart.resize();
- });
- }
- })
|