$(function(){ title = title + "-申请量"; $('#input_reverse').change(function(){ var XYName; XYName = c_XAxisName; c_XAxisName = c_YAxisName; c_YAxisName = XYName; if(this.checked==true){ ISRESERVE = 1; concatp(); loadCharts(); }else{ ISRESERVE = 0; concat(); loadCharts(); } }) // y轴begin var html = ''; for(var i = 0;i'; } $('#modalb1')[0].innerHTML = html; $('#mybody').click(function(){ $('#btn_cnt').hide(); $('#modalb1').hide(); STEP = 0; }) $('#modalb1 div').mouseenter(function () { $(this).css('color','white'); $(this).css('background','#3098fe'); }) $('#modalb1 div').mouseleave(function () { $(this).css('background','white'); $(this).css('color','black'); }) $('#modalb1 div').click(function () { $('#modalb1').css('display','none'); var YTITLE = $(this)[0].innerText.trim(); $('#fig_btn1')[0].innerHTML = YTITLE; Y = CARR.indexOf(YTITLE); var locationtitle = -1; locationtitle = title.lastIndexOf('-'); title = locationtitle != -1 ? title.substring(0, locationtitle+1) + YTITLE : title; loadCharts(); }) // y轴end $('#fig_btn1').click(function () { $('#modalb1').toggle(); }) $('#input_legend').change(function(){ if(this.checked==true){ LEGENDMODE = true; loadCharts(); }else{ LEGENDMODE = false; loadCharts(); } }) $('#input_label').change(function(){ if(this.checked==true){ LABELSHOW = true; loadCharts(); }else{ LABELSHOW = false; loadCharts(); } }) $('#charts1').css("height",cheight); $('#charts1').css("width",cwidth); loadCharts(); window.onresize = function(){ $(".warp").css("left",document.body.clientWidth-23); $(".warp").css("top",document.body.clientHeight-25); cheight = document.documentElement.clientHeight-2; cwidth = document.documentElement.clientWidth; $('#charts1').css("height",cheight); $('#charts1').css("width",cwidth); myChart1.resize(); } }) var Y = 0; //c++参数转换为js参数 if(c_bNameT=='0'){ c_bNameT = false; }else{ c_bNameT = true; } if(c_bNameL=='0'){ c_bNameL = false; }else{ c_bNameL = true; } if(c_bNameX=='0'){ c_bNameX = false; }else{ c_bNameX = true; } if(c_bNameY=='0'){ c_bNameY = false; }else{ c_bNameY = true; } //c++参数转换为js参数 var data = [1]; var COLORS = THEMECOLOR[Number(c_nTheme)]; var arrname1 = ARRKEY1; var arrname2 = ARRKEY2; var arrvalue = ARRVALUE; //console.log(fmxData,'123'); var dataLength = 1; if(typeof TextP=='undefined'||TextP==''){ var MYTEXT = [[],[],[],[],[],[]]; }else{ var MYTEXT = TextP.split('&&'); for(var i = 0;i ARRKEY2[j]){ pos = j } } var mid = ARRKEY2[i] ARRKEY2[i] = ARRKEY2[pos] ARRKEY2[pos] = mid for(var j = 0; j < ARRVALUE.length; j++){ mid = ARRVALUE[j][i] ARRVALUE[j][i] = ARRVALUE[j][pos] ARRVALUE[j][pos] = mid } } //添加注释begin if(MYTEXT[0].length!=0){ $('#div_tips1').css('left',Number(MYTEXT[0][0])*cwidth+cwidth/s_numX1); $('#div_tips1').css('top',Number(MYTEXT[0][1])*cheight+cheight/s_numY1); $('#div_tips1').html(MYTEXT[0][2]); $('#div_tips1').css('fontSize',inputFS+'px'); } //添加注释end var MD5ARR; var arrvaluep2; var arrnamep2; var arrnamep1; var arrvaluetemp = []; var arrvalueF = []; for(var i = 0;i=mymax){ mymax = Number(arrvaluep2[j][i].split(':')[Y+1]); } } } //console.log(mymax,'mymax'); myChart1 = echarts.init(document.getElementById('charts1'),c_nTheme); fmxData = fmxData.map(function (item) { return [item[1], item[0], item[2] || '-']; }); var option1 = { animation: ani, title:{ show:c_bNameT, text: title, //subtext: CARR[Y[0]-1], x:c_szXAlignT, y:c_szYAlignT, textStyle:{ color:c_szColorT, fontSize:Number(c_nSizeT), fontFamily:c_szFamilyT, fontStyle:c_szStyleT, fontWeight:c_szWeightT, }, }, toolbox: { show: true, feature: { // dataZoom: {}, //dataView: {readOnly: false}, saveAsImage:{} } }, tooltip: { position: 'top', formatter:function(e){ if (ISRESERVE==1) return CARR[Y]+'
'+'x:'+arrname2[e.data[0]]+'
'+'y:'+arrname1[e.data[1]]+'
'+'z:'+e.data[2]; else return CARR[Y]+'
'+'x:'+arrname1[e.data[0]]+'
'+'y:'+arrname2[e.data[1]]+'
'+'z:'+e.data[2]; //console.log(e,'e'); } }, grid: { left:c_szMarginLeftP, right:c_szMarginRightP, top:c_szMarginTopP, bottom:c_szMarginBottomP, }, xAxis: { type: 'category', data: arrnamep1, splitArea: { show: true }, show:c_bNameX, name:c_XAxisName, nameLocation:c_szLocationX, nameTextStyle:{ color:c_szColorX, fontSize:c_nSizeX, fontFamily:c_szFamilyX, fontStyle:c_szStyleX, fontWeight:c_szWeightX, }, axisLabel:{ interval:0, rotate:c_szXRotate, color:c_szColorX, fontSize:c_nSizeX, fontFamily:c_szFamilyX, fontStyle:c_szStyleX, fontWeight:c_szWeightX, formatter:function(value) { var ret = "";//拼接加\n返回的类目项 if (value.indexOf('|') > -1) { var arr = value.split(' | ') for(var i=0;i0){ ret += '{v|' + arr[i] + '}\n' }else{ ret += '{v1|' + arr[i] + '}\n' } } return ret } else { value = value.replace(" ",""); var maxLength = 4;//每项显示文字个数 var valLength = value.length;//X轴类目项的文字个数 var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数 if (rowN > 1) { for (var i = 0; i < rowN; i++) { var temp = "";//每次截取的字符串 var start = i * maxLength;//开始截取的位置 var end = start + maxLength;//结束截取的位置 //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧 if(i>0){ temp = '{v|' + value.substring(start, end) +'}\n'; }else{ temp = '{v1|' + value.substring(start, end) +'}\n'; } ret += temp; //凭借最终的字符串 } return ret; } else { return value; } } }, rich:{ v:{ fontSize:c_nSizeX, fontFamily:c_szFamilyX, fontStyle:c_szStyleX, fontWeight:c_szWeightX, padding: [0, 0, 5, 0], }, v1:{ fontSize:c_nSizeX, fontFamily:c_szFamilyX, fontStyle:c_szStyleX, fontWeight:c_szWeightX, padding: [0, 0, -5, 0], }, } }, axisLine:{ show:true, lineStyle:{ width:c_szLineWidthX, color: c_szLineColorX } }, splitLine:{ lineStyle:{ width:c_szSplitLineWidthX, type:c_szSplitLineTypeX } }, }, yAxis: { type: 'category', data: arrnamep2, splitArea: { show: true }, show:c_bNameY, name:c_YAxisName, nameLocation:c_szLocationY, nameTextStyle:{ color:c_szColorY, fontSize:c_nSizeY, fontFamily:c_szFamilyY, fontStyle:c_szStyleY, fontWeight:c_szWeightY, }, axisLabel:{ interval:0, rotate:c_szYRotate, color:c_szColorY, fontSize:c_nSizeY, fontFamily:c_szFamilyY, fontStyle:c_szStyleY, fontWeight:c_szWeightY, formatter:function(value) { if(value.indexOf("-")>-1){ var arr2 = value.split("-") value = arr2[0] } var ret = "";//拼接加\n返回的类目项 if (value.indexOf('|') > -1) { var arr = value.split(' | ') for(var i=0;i16){ var l = Math.ceil(valLength / 4); for(var i=0;i<4;i++){ var temp = "";//每次截取的字符串 var start = i * l;//开始截取的位置 var end = start + l;//结束截取的位置 //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧 if(i==3){ temp = '{v1|' + value.substring(start, end) +'}'; }else{ temp = '{v|' + value.substring(start, end) +'}\n'; } ret += temp; //凭借最终的字符串 } return ret; }else{ value = value.replace(" ",""); if (rowN > 1) { for (var i = 0; i < rowN; i++) { var temp = "";//每次截取的字符串 var start = i * maxLength;//开始截取的位置 var end = start + maxLength;//结束截取的位置 //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧 if(i==rowN-1){ temp = '{v1|' + value.substring(start, end) +'}'; }else{ temp = '{v|' + value.substring(start, end) +'}\n'; } ret += temp; //凭借最终的字符串 } return ret; } else { return value; } } } }, rich:{ v:{ fontSize:c_nSizeY, fontFamily:c_szFamilyY, fontStyle:c_szStyleY, fontWeight:c_szWeightY, padding:[5,0,0,0] }, v1:{ fontSize:c_nSizeY, fontFamily:c_szFamilyY, fontStyle:c_szStyleY, fontWeight:c_szWeightY, }, } }, axisLine:{ show:true, lineStyle:{ width:c_szLineWidthY, color: c_szLineColorY } }, splitLine:{ lineStyle:{ width:c_szSplitLineWidthY, type:c_szSplitLineTypeY } }, }, visualMap: { min: 0, max: mymax, calculable: true, show:c_bNameL, orient:c_szLayoutL, x:c_szxalignL, y:c_szyalignL, padding:parseInt(c_nSizeT)-20+30, textStyle:{ color:c_szColorL, fontSize:c_nSizeL, fontFamily:c_szFamilyL, fontStyle:c_szStyleL, fontWeight:c_szWeightL, }, inRange:{ color:[COLORS[0],COLORS[1]] } }, series: [{ name: CARR[Y-1], type: 'heatmap', data: fmxData, label: { normal: { show: LABELSHOW, color:c_szColorP, fontSize:c_nSizeP, fontFamily:c_szFamilyP, fontStyle:c_szStyleP, fontWeight:c_szWeightP, } }, itemStyle: { normal:{ opacity:c_szOpacityP, borderColor:c_szLineColorP, borderWidth:c_szLineWidthP, borderType:c_szLineTypeP, shadowBlur:c_szShadowSizeP, shadowColor:c_szShadowColorP, shadowOffsetX:c_szShadowXP, shadowOffsetY:c_szShadowYP }, emphasis: { shadowBlur: 10, shadowColor: 'rgba(0, 0, 0, 0.5)' } } }] }; myChart1.setOption(option1); }