⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pillarstat.htc

📁 HTC,demo WEB用于。 超大型
💻 HTC
📖 第 1 页 / 共 5 页
字号:
	var vTopDistance = 100;
	var spaceValue = 100;
	var strDebugger = "";
	var pillarHeight = 0;
	var vTopAdjust = 0;
	
	if(!objXMLDoc) return;
	var oItemNodesList = objXMLDoc.selectNodes("//root/item");//区域节点
	intNodeListLength = oItemNodesList.length;		
	var yScale = Math.ceil(parseFloat(1750/intNodeListLength));
	var xScale = Math.ceil(maxPatientNum/10);
	
	pillarHeight = parseInt((1750 - (intNodeListLength+1)*spaceValue)/intNodeListLength);
	if(pillarHeight<0) pillarHeight =0;

	if(!oItemNodesList || oItemNodesList.length==0){
		objContainerDiv.style.background = "#cccccc";			
		with(objInfoSpan.style){
			visibility = "visible";	
			width = 120;
			height = 30;
			left = (parseInt(objContainerDiv.style.width) + parseInt(element.offsetLeft))/2 - parseInt(objInfoSpan.style.width)/2;
			top = (parseInt(objContainerDiv.style.height) + parseInt(element.offsetTop))/2 - parseInt(objInfoSpan.style.height)/2;
		}
		objInfoSpan.innerText = "数据加载失败......";
		return;	
	}else{
		objContainerDiv.innerHTML = "";
		objContainerDiv.style.background = "";
		objInfoSpan.innerText = "";
	}
	
	if(intNodeListLength >16){
		intTitleWidth = 5400;
	}else{
		intTitleWidth = 4700;
	}
	
	/////////装配柱图标题vml代码////////////////////////
	if(booleanHasBorder){
		vmlTitle = "<v:rect style='position:absolute;width:" + intTitleWidth + "px;height:2900px;z-index:1;' coordsize='21600,21600' filled='false' strokecolor='" + vBorderColor + "' strokeweight='" + vBorderWeight + "'></v:rect><v:shape style='position:absolute;left:0px;top:80px;width:" + intTitleWidth + "px;height:400px;text-align:center;z-index:1'><div style='font-size:10.5pt;font-weight:bold;'>" + vCaption + "</div></v:shape>";
	}else{
		vmlTitle = "<v:rect style='position:absolute;width:" + intTitleWidth + "px;height:2900px;z-index:1;' coordsize='21600,21600' filled='false' stroked='false'></v:rect><v:shape style='position:absolute;left:0px;top:80px;width:" + intTitleWidth + "px;height:400px;text-align:center;z-index:1'><div style='font-size:10.5pt;font-weight:bold;'>" + vCaption + "</div></v:shape>";
	}	
	////////装配扩展坐标系vml代码////////////////
	vmlExtendCoordinate += "<v:shape id='boxbottom' FillColor='" + vExtendCoordinateBaseColor + "'style='position:absolute;width:2000;height:2000;z-index:1;' path = 'm 500,2500 l 700,2300,3500,2300,3300,2500,500,2500,x e'><v:fill color2='white' rotate='t' angle='150' type='gradient'/></v:shape><v:shape id='boxleft' fillColor='" + vExtendCoordinateBackColor + "'style='position:absolute;width:2000;height:2000;z-index:1;' path = 'm 500,2500 l 700,2300,3500,2300,3500,300,700,300,500,500,500,2500,x e'><v:fill color2='white' rotate='t' angle='250' type='gradient'/></v:shape>";	
	for(var i=0;i<10;i++){//装配扩展坐标系
		//水平左虚线 
		vmlExtendCoordinate += "<v:line  from='" + (900 + i*290) + ",2300' to='" + (700 + i*290) + ",2500'  style='z-index:1;' strokecolor='" + vExtendCoordinateLineColor + "' strokeweight='1pt'/>";	
		//水平右虚线
		vmlExtendCoordinate += "<v:line  from='" + (900 + i*290) + ",300' to='" + (900 + i*290) + ",2300'  style='z-index:1;' strokecolor='" + vExtendCoordinateLineColor + "' strokeweight='1pt'/>";
		//x轴刻度线//////////////////////////////////////////////////////	
		if(booleanYScaleIsInteger && maxPatientNum % 10 != 0){//y轴刻度为整型
			maxPatientNum = maxPatientNum + (10 - maxPatientNum % 10);
		}
		if(i==0){//x轴第一个刻度
			vmlExtendCoordinate += "<v:shape style='position:absolute;left:400px;top:2550px;width:400px;height:100px;z-index:1'><div align='left' style='font-size:8pt;font-weight:bold;'>0</div></v:shape>";
		}else{//x轴中间刻度
			vmlExtendCoordinate += "<v:shape style='position:absolute;left:" + (350 + 280*i) + "px;top:2550px;width:400px;height:100px;z-index:1'><div align='left' style='font-size:8pt;'>" + Math.round((maxPatientNum/10)*i*100)/100 + "</div></v:shape>";
		}
		if(i==9){//x轴最后一个刻度
			vmlExtendCoordinate += "<v:shape style='position:absolute;left:3180px;top:2550px;width:400px;height:100px;z-index:1'><div align='left' style='font-size:8pt;'>" + Math.round(maxPatientNum*100)/100 + "</div></v:shape>";
		}	 
		
	}
	//装配扩展坐标系交接线	 
	vmlExtendCoordinate += "<v:line  from='700,300' to='700,2300'  style='z-index:1;' strokecolor='#666666' strokeweight='1pt'/>";
	/////////装配柱图vml代码////////////////////////////////
	//window.status = "pillarHeight:" + pillarHeight + "  yScale:" + yScale;
	
	for(var i=0;i<intNodeListLength;i++){//装配柱图		
		vmlCaky += "";		
		
		//柱状图
		if(intNodeListLength ==1){
			vTopAdjust = 1550;
		}else if(intNodeListLength ==2){
			vTopAdjust = 680;
		}else if(intNodeListLength == 3){
			vTopAdjust = 320;
		}else if(intNodeListLength==4){
			vTopAdjust = 185;
		}else if(intNodeListLength >= 4 && intNodeListLength <= 7){
			vTopAdjust = 80;
		}
		//y轴标记值//////////////////////////////////////////////////////
		if(pillarHeight >20){	
			vmlCaky += "<v:shape style='position:absolute;left:150px;top:" + (2150 - i*yScale - vTopAdjust/2) + "px;width:400px;height:100px;z-index:1;'><div align='left' style='font-size:9pt;' title='" + oItemNodesList[i].childNodes[0].text + "'>" + oItemNodesList[i].childNodes[0].text + "</div></v:shape>"; 
		}else if(pillarHeight<=20){
			vmlCaky += "<v:shape style='position:absolute;left:150px;top:" + (2200 - i*yScale) + "px;width:400px;height:100px;z-index:1;'><div align='left' style='font-size:9pt;' title='" + oItemNodesList[i].childNodes[0].text + "'>" + oItemNodesList[i].childNodes[0].text + "</div></v:shape>"; 
		}
		if(booleanSingleExtrusionColor){//使用单色填充	
		//装配柱图
			if(pillarHeight >20){	
				if(vPsStyle == "2"){//圆柱图
					if(parseFloat(oItemNodesList[i].childNodes[1].text) == 0){
						vmlCaky += "<v:rect title='" + oItemNodesList[i].childNodes[0].text + "\n数值:" + oItemNodesList[i].childNodes[1].text + " 百分比:0%' style='position:absolute;left:590px;top:" + (2100-i*yScale + 50 - vTopAdjust) + "px;width:" + ((3000/maxPatientNum)*(parseFloat(oItemNodesList[i].childNodes[1].text)) - 120) + "px;height:" + pillarHeight + "px;z-index:1' fillcolor='" + objPillarColorArray[i] + "'><v:fill color2='white' rotate='t' angle='180' focus='50%' type='gradient'/></v:rect>";
					}else{
						vmlCaky += "<v:rect title='" + oItemNodesList[i].childNodes[0].text + "\n数值:" + oItemNodesList[i].childNodes[1].text + " 百分比:" + oItemNodesList[i].childNodes[2].text + "' style='position:absolute;left:590px;top:" + (2100-i*yScale + 50 - vTopAdjust) + "px;width:" + ((3000/maxPatientNum)*(parseFloat(oItemNodesList[i].childNodes[1].text)) - 120) + "px;height:" + pillarHeight + "px;z-index:1' fillcolor='" + objPillarColorArray[i] + "'><v:fill color2='white' rotate='t' angle='180' focus='50%' type='gradient'/></v:rect>";	
					}
				}else{//直方图
					if(parseFloat(oItemNodesList[i].childNodes[1].text) == 0){
						vmlCaky += "<v:rect title='" + oItemNodesList[i].childNodes[0].text + "\n数值:" + oItemNodesList[i].childNodes[1].text + " 百分比:0%' style='position:absolute;left:590px;top:" + (2100-i*yScale + 50 - vTopAdjust) + "px;width:" + ((3000/maxPatientNum)*(parseFloat(oItemNodesList[i].childNodes[1].text)) - 120) + "px;height:" + pillarHeight + "px;z-index:1' fillcolor='" + objPillarColorArray[i] + "'><v:fill color2='white' rotate='t' angle='-270' type='gradient'/><o:extrusion v:ext='view' backdepth='" + vExtrusiondepth + "' color='" + vExtrusionColor + "' skewangle='230' on='t'/></v:rect>";
					}else{
						vmlCaky += "<v:rect title='" + oItemNodesList[i].childNodes[0].text + "\n数值:" + oItemNodesList[i].childNodes[1].text + " 百分比:" + oItemNodesList[i].childNodes[2].text + "' style='position:absolute;left:590px;top:" + (2100-i*yScale + 50 - vTopAdjust) + "px;width:" + ((3000/maxPatientNum)*(parseFloat(oItemNodesList[i].childNodes[1].text)) - 120) + "px;height:" + pillarHeight + "px;z-index:1' fillcolor='" + objPillarColorArray[i] + "'><v:fill color2='white' rotate='t' angle='-270' type='gradient'/><o:extrusion v:ext='view' backdepth='" + vExtrusiondepth + "' color='" + vExtrusionColor + "' skewangle='230' on='t'/></v:rect>";	
					}	
				}
			}else if(pillarHeight<=20){
				if(vPsStyle == "2"){//圆柱图
					if(parseFloat(oItemNodesList[i].childNodes[1].text) == 0){
						vmlCaky += "<v:rect title='" + oItemNodesList[i].childNodes[0].text + "\n数值:" + oItemNodesList[i].childNodes[1].text + " 百分比:0%' style='position:absolute;left:590px;top:" + (2200-i*yScale) + "px;width:" + ((3000/maxPatientNum)*(parseFloat(oItemNodesList[i].childNodes[1].text)) - 120) + "px;height:" + pillarHeight + "px;z-index:1' fillcolor='" + objPillarColorArray[i] + "'><v:fill color2='white' rotate='t' angle='180' focus='50%' type='gradient'/></v:rect>";
					}else{
						vmlCaky += "<v:rect title='" + oItemNodesList[i].childNodes[0].text + "\n数值:" + oItemNodesList[i].childNodes[1].text + " 百分比:" + oItemNodesList[i].childNodes[2].text + "' style='position:absolute;left:590px;top:" + (2200-i*yScale + 50) + "px;width:" + ((3000/maxPatientNum)*(parseFloat(oItemNodesList[i].childNodes[1].text)) - 120) + "px;height:" + pillarHeight + "px;z-index:1' fillcolor='" + objPillarColorArray[i] + "'><v:fill color2='white' rotate='t' angle='180' focus='50%' type='gradient'/></v:rect>";	
					}
				}else{//直方图
					if(parseFloat(oItemNodesList[i].childNodes[1].text) == 0){
						vmlCaky += "<v:rect title='" + oItemNodesList[i].childNodes[0].text + "\n数值:" + oItemNodesList[i].childNodes[1].text + " 百分比:0%' style='position:absolute;left:590px;top:" + (2200-i*yScale) + "px;width:" + ((3000/maxPatientNum)*(parseFloat(oItemNodesList[i].childNodes[1].text)) - 120) + "px;height:" + pillarHeight + "px;z-index:1' fillcolor='" + objPillarColorArray[i] + "'><v:fill color2='white' rotate='t' angle='-270' type='gradient'/><o:extrusion v:ext='view' backdepth='" + vExtrusiondepth + "' color='" + vExtrusionColor + "' skewangle='230' on='t'/></v:rect>";
					}else{
						vmlCaky += "<v:rect title='" + oItemNodesList[i].childNodes[0].text + "\n数值:" + oItemNodesList[i].childNodes[1].text + " 百分比:" + oItemNodesList[i].childNodes[2].text + "' style='position:absolute;left:590px;top:" + (2200-i*yScale + 50) + "px;width:" + ((3000/maxPatientNum)*(parseFloat(oItemNodesList[i].childNodes[1].text)) - 120) + "px;height:" + pillarHeight + "px;z-index:1' fillcolor='" + objPillarColorArray[i] + "'><v:fill color2='white' rotate='t' angle='-270' type='gradient'/><o:extrusion v:ext='view' backdepth='" + vExtrusiondepth + "' color='" + vExtrusionColor + "' skewangle='230' on='t'/></v:rect>";	
					}
				}
			}

			//图例	
			if(booleanHasLegend){
				if(i >= (intNodeListLength - 16)){	
					if(vPsStyle == "2"){//圆柱图
						vmlLegend += "<v:shape style='position:absolute;left:300px;top:" + ((intNodeListLength - (i-16))*130 - 2050) + "px;width:900px;height:100px;z-index:1'><div style='padding-left:5;font-size:12px;' title='" + oItemNodesList[i].childNodes[0].text + "'>" + oItemNodesList[i].childNodes[0].text + "</div></v:shape><v:rect title='" + oItemNodesList[i].childNodes[0].text + "' style='left:100px;top:" + ((intNodeListLength - (i-16))*130 + 20 - 2050) + "px;width:120px;height:60px;z-index:1;' fillcolor='" + objPillarColorArray[i] + "' strokecolor='black'><v:fill color2='white' rotate='t' angle='180' focus='50%' type='gradient'/></v:rect>";
					}else{//直方图
						vmlLegend += "<v:shape style='position:absolute;left:300px;top:" + ((intNodeListLength - (i-16))*130 - 2050) + "px;width:900px;height:100px;z-index:1'><div style='padding-left:5;font-size:12px;' title='" + oItemNodesList[i].childNodes[0].text + "'>" + oItemNodesList[i].childNodes[0].text + "</div></v:shape><v:rect title='" + oItemNodesList[i].childNodes[0].text + "' style='left:100px;top:" + ((intNodeListLength - (i-16))*130 + 20 - 2050) + "px;width:120px;height:60px;z-index:1;' fillcolor='" + objPillarColorArray[i] + "' strokecolor='black'><v:fill color2='white' rotate='t' angle='-270' type='gradient

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -