var uploadedDataURL = "/template/bjpc/home/json/data-1499156198404-H1AJkAOEZ.json"; //var year = new Date().getFullYear(); var year = 2018; function GetInitData() { $.ajax({ type: "post", url:"/bjinvest/initInvestMapData", async: true, dataType: "json", success: function (data) { var mapTip,mapData,pieData; mapTip=data.dataMapTips; mapData=data.dataMap; pieData=data.dataPie; showProvince(mapTip,mapData,data.minNum,data.maxNum); setPie(pieData); }, error: function () { alertWin("请求超时,请重试!"); } }); } function showProvince(mapTip,mapData,minNum,maxNum) { var myChart = echarts.init(document.getElementById('map')); var name = 'bj'; console.log(mapTip) // myChart.showLoading(); $.get(uploadedDataURL, function(geoJson) { // myChart.hideLoading(); echarts.registerMap(name, geoJson); myChart.setOption(option = { backgroundColor: '#ffffff', title: { text: "投资项目在线审批监管平台", //subtext: "("+year+"年)申报项目概览(单位:亿元)", subtext: "(2018年)申报项目概览(单位:亿元)", left: '10%', top:20, textStyle: { color: '#0399d4' }, subtextStyle:{ color: '#0399d4' } }, tooltip: { trigger: 'item', formatter: function (params) { if(mapTip[0].hasOwnProperty(params.name)){ var html="",currentJson=mapTip[0][params.name]; html += params.name+ " "; html += "共"+currentJson.total+"个项目
"; html += "总投资:"+currentJson.ztz+"亿元
市政府投资:"+currentJson.szftz+"亿元
区政府投资:"+currentJson.qzftz+"亿元
其它投资:"+currentJson.qttz+"亿元"; return html; } /*if(params.name ==='东城区') { html += params.name + " "; html += "共244个项目
"; html += "总投资:244.001亿元
市政府投资:73.159亿元
区政府投资:6.719亿元
其它投资:164.124亿元"; return html; } else if(params.name ==='西城区'){ html += params.name + " "; html += "共365个项目
"; html += "总投资1381.699亿元
市政府投资15.644亿元
区政府投资207.881亿元
其它投资1158.175亿元"; return html; } else if(params.name ==='朝阳区'){ html += params.name + " "; html += "共631个项目
"; html += "总投资:824.358亿元
市政府投资:22.014亿元
区政府投资:52.430亿元
其它投资:749.915亿元"; return html; } else if(params.name ==='海淀区'){ html += params.name + " "; html += "共958个项目
"; html += "总投资:1301.848亿元
市政府投资:20.759亿元
区政府投资:109.184亿元
其它投资:1171.905亿元"; return html; } else if(params.name ==='丰台区'){ html += params.name + " "; html += "共409个项目
"; html += "总投资:516.399亿元
市政府投资:16.848亿元
区政府投资:39.375亿元
其它投资:460.176亿元"; return html; } else if(params.name ==='石景山区'){ html += params.name + " "; html += "共166个项目
"; html += "总投资:130.039亿元
市政府投资:0.987亿元
区政府投资:3.531亿元
其它投资:125.522亿元"; return html; } else if(params.name ==='门头沟区'){ html += params.name + " "; html += "共155个项目
"; html += "总投资:268.176亿元
市政府投资:5.481亿元
区政府投资:13.924亿元
其它投资:248.772亿元"; return html; } else if(params.name ==='房山区'){ html += params.name + " "; html += "共356个项目
"; html += "总投资:473.098亿元
市政府投资:13.632亿元
区政府投资:6.354亿元
其它投资:453.113亿元"; return html; } else if(params.name ==='通州区'){ html += params.name + " "; html += "共345个项目
"; html += "总投资:1010.487亿元
市政府投资:16.308亿元
区政府投资:15.716亿元
其它投资:978.464亿元"; return html; } else if(params.name ==='顺义区'){ html += params.name + " "; html += "共466个项目
"; html += "总投资:570.289亿元
市政府投资:10.081亿元
区政府投资:66.314亿元
其它投资:493.894亿元"; return html; } else if(params.name ==='大兴区'){ html += params.name + " "; html += "共455个项目
"; html += "总投资:447.113亿元
市政府投资:32.127亿元
区政府投资:50.185亿元
其它投资:364.801亿元"; return html; } else if(params.name ==='昌平区'){ html += params.name + " "; html += "共522个项目
"; html += "总投资:1034.501亿元
市政府投资:5.449亿元
区政府投资:41.328亿元
其它投资:987.725亿元"; return html; } else if(params.name ==='平谷区'){ html += params.name + " "; html += "共170个项目
"; html += "总投资:161.600亿元
市政府投资:2.618亿元
区政府投资:8.354亿元
其它投资:150.629亿元"; return html; } else if(params.name ==='怀柔区'){ html += params.name + " "; html += "共282个项目
"; html += "总投资:64.450亿元
市政府投资:1.955亿元
区政府投资:3.710亿元
其它投资:58.786亿元"; return html; } else if(params.name ==='延庆区'){ html += params.name + " "; html += "共157个项目
"; html += "总投资:54.157亿元
市政府投资:0.693亿元
区政府投资:1.305亿元
其它投资:52.159亿元"; return html; } else if(params.name ==='密云区'){ html += params.name + " "; html += "共162个项目
"; html += "总投资:87.868亿元
市政府投资:3.106亿元
区政府投资:4.554亿元
其它投资:80.209亿元"; return html; }*/ } }, visualMap: { min: minNum, max: maxNum, left: 'left', top: 'bottom', text: ['高', '低'], // 文本,默认为数值文本 calculable: true, inRange: { color: ['rgb(55,0,170)', 'rgb(0,115,188)', 'rgb(254,121,5)'] } }, series: [{ type: 'map', mapType: name, label: { normal: { show: true, textStyle:{ color:"#eee" } }, emphasis: { textStyle: { color: '#fff' } } }, itemStyle: { normal: { borderColor: '#389BB7', areaColor: '#fff' }, emphasis: { areaColor: '#389BB7', borderWidth: 0 } }, animation: false, data: mapData // animationDurationUpdate: 1000, // animationEasingUpdate: 'quinticInOut' }] }); }); } /*[{ name: '东城区', value: 244.001 }, { name: '西城区', value: 1381.699 }, { name: '海淀区', value: 1301.848 }, { name: '朝阳区', value: 824.358 }, { name: '石景山区', value: 130.039 }, { name: '大兴区', value: 447.113 }, { name: '门头沟区', value: 268.176 }, { name: '昌平区', value: 1034.501 }, { name: '通州区', value: 1010.487, }, { name: '房山区', value: 473.098 }, { name: '丰台区', value: 516.399 }, { name: '顺义区', value: 570.289 }, { name: '怀柔区', value: 64.450 }, { name: '密云区', value: 87.868 }, { name: '延庆区', value: 54.157 }, { name: '平谷区', value: 161.600 }]*/ var currentIdx = 0; function setPie(pieData) { var myChart = echarts.init(document.getElementById('investment')); var colorArr=["rgb(255,185,0)","rgb(98,141,246)","rgb(0,215,0)"]; var option = { title: { //text: year+"年度投资来源数额(亿元)", text: "2018年度投资来源数额(亿元)", left: '10%', top:20, textStyle: { color: '#0399d4' }, subtextStyle:{ color: '#0399d4' } }, tooltip : { trigger: 'item', formatter: "{a}
{b}: {c}亿元
百分比: {d}%" }, series : [ { name: '投资来源', type: 'pie', radius : '55%', center: ['50%', '60%'], label:{ normal:{ fontSize:26, color:"rgb(255,185,0)" } }, data:pieData, itemStyle:{ normal:{ color:function (params) { console.log(params.dataIndex) return colorArr[params.dataIndex]; } }, emphasis: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' } }, /*data:[ {value:1045.141, name:'市政府投资(亿元)',itemStyle:{ normal:{ color:"rgb(255,185,0)" } }}, {value:20123.567, name:'其他投资(亿元)',itemStyle:{ normal:{ color:"rgb(98,141,246)" } }}, {value:731.427, name:'区政府投资(亿元)',itemStyle:{ normal:{ color:"rgb(0,215,0)" } }} ],*/ } ] }; myChart.setOption(option); } $(document).ready(function () { InitMenu(0); InitSwiper(); GetInitData(); $(".projectNav").click(function () { $(".projectNav").addClass("active"); $(".approNav").removeClass("active"); $(".publicity[data-num='1']").hide(); $(".publicity[data-num='0']").show(); }); $(".approNav").click(function () { $(".projectNav").removeClass("active"); $(".approNav").addClass("active"); $(".publicity[data-num='0']").hide(); $(".publicity[data-num='1']").show(); }); $("#informationMore").click(function () { if($(".projectNav").hasClass("active")){ location.href="/information/project"; } else { location.href="/information/examine"; } }); }); function InitSwiper() { var swiper = new Swiper('.swiper-container', { pagination: '.swiper-pagination', paginationClickable: true, autoplay : 3000, speed:300 }); }