Desktop.js 3.4 KB

1
  1. $(function(){var n=echarts.init(document.getElementById("mainChart")),t;n.setOption({backgroundColor:"#fff",title:{text:"用水分析",left:15,top:15,textStyle:{color:"#666666",fontSize:24,fontWeight:100,fontFamily:"微软雅黑"},subtext:"昨日用水量:15998 | 累计用水量:13293089",subtextStyle:{color:"#878787",fontSize:14,fontWeight:100,fontFamily:"微软雅黑"},itemGap:20},tooltip:{trigger:"axis",axisPointer:{type:"shadow",textStyle:{color:"#fff"}}},legend:{data:["每小时用水","预测用水"],x:15,y:95,textStyle:{color:"#878787"}},grid:{borderWidth:0,top:130,bottom:2,x:15,y:0,x2:0,y2:0,textStyle:{color:"#fff"}},xAxis:[{type:"category",boundaryGap:!1,data:["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24"],splitLine:!1,show:!1}],yAxis:[{type:"value",splitLine:!1,show:!1}],series:[{name:"每小时用水",type:"line",smooth:!0,areaStyle:{normal:{color:"#7b93e0"}},lineStyle:{normal:{color:"#7b93e0",width:0}},data:[0,0,80,100,150,160,170,200,220,240,200,180,120,100,160,180,200,210,250,200,180,170,200,240,280],symbol:"none"},{name:"预测用水",type:"line",smooth:!0,areaStyle:{normal:{color:"#2AE8DE"}},lineStyle:{normal:{color:"#2AE8DE",width:0}},data:[0,0,100,220,290,190,100,80,100,110,133,150,100,80,111,130,160,144,110,90,80,100,110,120,140],symbol:"none"}]});myChart1=echarts.init(document.getElementById("echart1"));t={backgroundColor:"#fff",title:{text:"DMA分区产销差",left:15,top:15,textStyle:{color:"#666666",fontSize:24,fontWeight:100,fontFamily:"微软雅黑"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{data:["一区","二区","三区"],x:"right",y:30,padding:[5,35,5,5]},grid:{borderWidth:0,top:100,left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:[{type:"category",data:["周一","周二","周三","周四","周五","周六","周日"],splitLine:!1,axisLine:!1,axisTick:!1}],yAxis:[{type:"value",splitLine:!1,axisLine:!1,axisTick:!1}],series:[{name:"二区",type:"bar",itemStyle:{normal:{color:"#2AE8DE"}},data:[840,900,1e3,800,880,1200,1e3]},{name:"一区",type:"bar",itemStyle:{normal:{color:"#7b93e0"}},data:[700,800,1100,900,600,1e3,800]},{name:"三区",type:"bar",itemStyle:{normal:{color:"#DDE0E5"}},data:[400,500,600,700,500,400,310]}]};myChart1.setOption(t);myChart2=echarts.init(document.getElementById("echart2"));option2={backgroundColor:"#fff",title:{text:"客户区域分布",left:15,top:15,textStyle:{color:"#666666",fontSize:24,fontWeight:100,fontFamily:"微软雅黑"}},tooltip:{trigger:"item",formatter:"{a} <br/>{b}: {c} ({d}%)"},toolbox:{show:!0,feature:{restore:{show:!0,title:"还原"},saveAsImage:{show:!0,title:"保存为图片",type:"png",lang:["点击保存"]}},padding:[25,25,5,5]},legend:{x:"left",y:"bottom",data:["一区","二区","三区","四区"],padding:[5,5,35,20]},series:[{name:"访问来源",type:"pie",radius:["45%","65%"],avoidLabelOverlap:!1,selectedMode:"single",label:{normal:{show:!1,position:"center"},emphasis:{show:!0,textStyle:{fontSize:"30",fontWeight:"bold"}}},labelLine:{normal:{show:!1}},data:[{value:335,name:"一区",itemStyle:{normal:{color:"#2AE8DE"}}},{value:234,name:"二区",itemStyle:{normal:{color:"#f06995"}}},{value:135,name:"三区",itemStyle:{normal:{color:"#F2B459"}}},{value:1548,name:"四区",itemStyle:{normal:{color:"#7b93e0"}}}]}]};myChart2.setOption(option2);window.onresize=function(t){n.resize(t);myChart1.resize(t);myChart2.resize(t)}})