// javascript document var powercolor=[ ['#015bac','#015bac','#ec6e2d'], ['#ec6e2d','#015bac','#ec6e2d'], ['#14a266','#015bac','#ec6e2d'], ['#14a266','#015bac','#ec6e2d'] ]; var powerdata=[ [ "水力发电装机容量", ['装机容量','总发电量'], ['万千瓦','(亿千瓦时)'], ['#00cc33','#00796a','#ec6e2d'], ['2011','2012','2013','2014','2015','2016','2017'], [15617,16861,18537,19882,20782,21589,22414], [4610,5845,6006,6804,7009,7657] ],[ "风力发电装机容量", ['装机容量','总发电量'], ['万千瓦','(亿千瓦时)'], ['#0066cc','#003366','#ec6e2d'], ['2011','2012','2013','2014','2015','2016','2017'], [4394, 5676, 7037, 8790, 11664, 13194,14539], [706,968,1290,1452,1661,2115] ],[ "太阳能发电装机容量", ['装机容量','总发电量'], ['万千瓦','(亿千瓦时)'], ['#ff9900','#cc3300','#ec6e2d'], ['2011','2012','2013','2014','2015','2016','2017'], [232, 333, 1546, 2445, 3973, 7206,12083], [6,36,84,227,377,627] ],[ "年度充电量和充换电次数", ['充电量','充换电'], ['万千瓦时','万次'], ['#14a266','#015bac','#ec6e2d'], ['2012','2013','2014','2015','2016','2017'], [7000, 5200, 7000, 34800, 82000, 229727], [130, 152, 200, 900, 1900, 5700] ],[ "月度充电量", ['2018','2017','历年平均'], ['万千瓦时','万千瓦时','万千瓦时'], ['#ec6e2d','#015bac','#14a266','#9900cc'], ['01','02','03','04','05','06','07','08','09','10','11','12'], [4145.17, 3855.81, 4238.00, 4473.00, 4706.00, , , , , , , ], [949.10, 969.37, 1250.66, 1333.58, 1563.56, 1686.35, 2053.37, 2191.42, 2313.43, 3489.00,3510.00,4076.00], //2016 [0.155, 0.414, 0.246, 0.758, 2.52, 13.01, 47.54, 89.66, 196.15, 404.69, 485.06, 769.27], [316.42, 323.26, 416.97, 444.78, 522.03, 566.47, 700.33, 760.45, 836.65, 1297.97, 1331.72, 1615.13] //2015 [ , , , , 0.004, 0.053, 0.091, 0.270, 0.359, 0.212, 0.087, 0.106] ],[ "累计线路长度", ['累计线路长度','累计线路长度'], ['万公里','万公里'], ['#0066cc','#003366'], ['2008','2009','2010','2011','2012','2013','2014','2015','2016','2017'], [640, 640, 2542, 2542, 4601, 5899, 10977, 10977, 16937, 24637] ],[ "累计变电(换流)容量", ['累计容量','累计容量'], ['万千伏安/万千瓦','万千伏安/万千瓦'], ['#ec6e2d','#003366'], ['2008','2009','2010','2011','2012','2013','2014','2015','2016','2017'], [600, 600, 1880, 3080, 4520, 6620, 11620, 11620, 18320, 25620] ],[ "累计输送电量", ['累计输送电量','累计输送电量'], ['亿千瓦时','亿千瓦时'], ['#00cc33','#003366'], ['2008','2009','2010','2011','2012','2013','2014','2015','2016','2017'], [0.77, 177.31, 475.95, 666.83, 1090.21, 1897.85, 3362.30, 4967.49, 6828.42, 8545.77] ] ]; var convertoption=function(idx){ var option = { color: powerdata[idx][3], title : { show:true, text: powerdata[idx][0], x:'center', y:'10', textstyle:{color: '#000',fontsize: 13,fontweight:'normal'} }, tooltip : { trigger: 'axis', axispointer:{ type : 'shadow' }, backgroundcolor: 'rgba(0,121,106,0.8)', bordercolor: 'rgba(255,255,255,0.9)', borderwidth: 2, formatter: function(params) { return params[0].name + '年
' + params[0].seriesname + ':' + params[0].value + ' ' + powerdata[idx][2][0]; }, textstyle: {fontsize: 12}, padding: 5 }, legend: { show:false, orient: 'horizontal', x:'center', y:'bottom', padding:0, itemgap: 6, //selectedmode:'single', data: powerdata[idx][1], textstyle : { color: '#000' } }, grid: { x:50, y:30, x2:25, y2:25, containlabel: true }, calculable : false, xaxis : [ { type : 'category', axislabel: { show: true, rotate: 0, textstyle: { fontsize:10 } }, boundarygap:false, data : powerdata[idx][4] } ], yaxis : [ { type: 'value', //name: powerdata[idx][2][0], position: 'left', axislabel: { show: true, textstyle: { fontsize:10 }, formatter: function (value, index) { return value/10000+'亿'; } } } ], series : [ { name:powerdata[idx][1][0], type:'line', //bargap: '50%', //barcategorygap: '50%', itemstyle:{ normal:{barborderradius: [3, 3, 0, 0]}, emphasis:{barborderradius: [3, 3, 0, 0]} }, data:powerdata[idx][5] } ] }; if(idx>4){ option["xaxis"][0]["axislabel"]["rotate"]=45; option["grid"]["y2"]=37; } //console.log(option); return option; } var convertoption2=function(idx){ var option = { color: powerdata[idx][3], title : { show:true, text: powerdata[idx][0], x:'center', y:'10', textstyle:{color: '#000',fontsize: 13,fontweight:'normal'} }, tooltip : { trigger: 'axis', axispointer:{ type : 'shadow' }, backgroundcolor: 'rgba(0,121,106,0.8)', bordercolor: 'rgba(255,255,255,0.9)', borderwidth: 2, formatter: function(params) { if(params[0].name.length>2){ tips=params[0].name + '年'; }else{ tips=params[0].name + '月'; } for(i=0;i' + params[2].seriesname + ':' + params[0].value + ' ' + powerdata[idx][2][0]; }, textstyle: {fontsize: 12}, padding: 5 }, legend: { show:true, orient: 'horizontal', x:'center', y:'bottom', padding:0, itemgap: 6, selectedmode:false,//'single', data: powerdata[idx][1], textstyle : { color: '#000' } }, grid: { x:50, y:30, x2:15, y2:40, containlabel: true }, calculable : false, xaxis : [ { type : 'category', boundarygap:false, axislabel: { show: true, textstyle: { fontsize:10 } }, data : powerdata[idx][4] } ], yaxis : [ { type: 'value', //name: powerdata[idx][2][0], position: 'left', axislabel: { show: true, textstyle: { fontsize:10 }, formatter: function (value, index) { if(value==0){ return value; }else if(value<10000){ return value+'万'; }else{ return value/10000+'亿'; } } } }, { type: 'value', //name: powerdata[idx][2][1], position: 'right', splitline: {show: false}, axislabel: { show: true, textstyle: { fontsize:10 }, formatter: function (value, index) { if(value==0){ return value; }else if(value<10000){ return value+'万'; }else{ return value/10000+'亿'; } } } } ], series : [ { name:powerdata[idx][1][0], type:'line', //bargap: '50%', barcategorygap: '50%', itemstyle:{ normal:{barborderradius: [3, 3, 0, 0]}, emphasis:{barborderradius: [3, 3, 0, 0]} }, data:powerdata[idx][5] },{ name:powerdata[idx][1][1], type:'line', itemstyle:{ normal:{barborderradius: [3, 3, 0, 0]}, emphasis:{barborderradius: [3, 3, 0, 0]} }, yaxisindex: 1, data:powerdata[idx][6] } ] }; if(powerdata[idx][2][0]==powerdata[idx][2][1]){ option["series"][1]["yaxisindex"]=0; }else{ option["grid"]["x2"]=50; } if(powerdata[idx][1][2]){ option["series"].push( { name:powerdata[idx][1][2], type:'line', itemstyle:{ normal:{barborderradius: [3, 3, 0, 0]}, emphasis:{barborderradius: [3, 3, 0, 0]} }, //yaxisindex: 1, data:powerdata[idx][7] } /*,{ name:powerdata[idx][1][3], type:'line', itemstyle:{ normal:{barborderradius: [3, 3, 0, 0]}, emphasis:{barborderradius: [3, 3, 0, 0]} }, //yaxisindex: 1, data:powerdata[idx][8] }*/ ); } //console.log(option); return option; } // 充电桩数[总数,其他社会总数,国网总数] var zhuang1=[168924,122770,46154]; var zhuang1=[234000,183000,51000]; var shehuizhuang="|- 特来电:52607个
|- 星星充电:22629个
|- 普天:10414个
|- 龙城智讯:2862个
|- 南网运营:1544个
"; option5 = { color: ['#00796a','#015bac'], title : { show:true, text:'各运营商充电桩接入数量', subtext:'', sublink: '', x:'center', y:'15', textstyle:{color: '#000',fontsize: 13,fontweight:'normal'} }, tooltip : { trigger: 'axis', enterable: true, axispointer:{ type : 'shadow' }, formatter: function (params) { var tar1; var temp=""; /* tar1 = params[1]; if(tar1.value>0){ temp = '南网运营
' + tar1.value + '个
'; }else{ temp=''; } */ var tar; tar = params[0]; temp = tar.name + ':' + tar.value + '个
'; if(tar.name=='社会运营'){ //temp += shehuizhuang; } return temp; }, backgroundcolor: 'rgba(0,121,106,0.8)', bordercolor: 'rgba(255,255,255,0.9)', borderwidth: 2, textstyle: {fontsize: 12}, padding: 5 }, grid: { x:45, y:40, x2:15, y2:25, containlabel: true }, calculable : false, xaxis : [ { type : 'category', axislabel: { show: true, textstyle: { fontsize:10 } }, data : ['总数','社会运营','国网自营'] } ], yaxis : [ { type : 'value', //splitnumber:5, //max:170000, axislabel: { show: true, formatter: function (value, index) { return value/10000+'万'; }, textstyle: { fontsize:10 } } } ], series : [ { name:'充电桩', type:'bar', //stack: '总量', barwidth: 25, itemstyle:{ normal:{ barborderradius: 4, color:function(params) { var colorlist = ['#66cc66','#33cc99']; if(params.dataindex==0){ return colorlist[0]; }else{ return colorlist[1]; } } }, emphasis:{ barborderradius: 4 } }, data: zhuang1 } ] };