日期:2014-05-20  浏览次数:20745 次

IE兼容问题
HTML code
<%@ page language="java" import="java.util.Hashtable,com.webgame.core.validate.*,java.util.Iterator,java.util.List,com.webgame.core.basic.BaseHibernateDAO,com.webgame.core.dao.*, com.webgame.core.pojo.*" pageEncoding="GBK"%>

<%@page contentType="text/html;charset=GBK"%>

<%@page import="java.util.ArrayList"%><HTML xmlns:v="urn:schemas-microsoft-com:vml"xmlns:o="urn:schemas-microsoft-com:office:office">
<link rev="stylesheet" media="all" href="VMLCurve.css" type="text/css" rel="stylesheet" />
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<style type="text/css">
<!--
v\:* { behavior: url(#default#VML);} o\:* { behavior: url(#default#VML);}
body {
    margin:0px;
    padding:0px;
    font-size:12px;
    text-align:left
}

.pBlack {
    font-weight:bold;
    font-size:12px;
}

.pRed {
    font-weight:bold;
    font-size:12px;
    color:#FF0000;
}

/*横坐标轴样式*/
.pMonth {
    font-size:66px;
    font-family:"黑体";
    color:#CCCCCC;
    letter-spacing: 3px;
}

/*提示信息样式*/
.ToolTip {
    padding:4px;
    margin:4px;
    background-color: #CCCCCC;
    border: 1px solid #0066FF;
    text-align:left;
}

/*标题显示样式*/
.Title {
    font-family:"宋体", "华文仿宋";
    font-size:16px;
    text-align:center;
    font-weight:bold;
    color:#996600;
    vertical-align:middle;
}

.curveBody{
    margin:0;
    padding:0;
    height:20px;
    font-size:12px;
}

.curveForm{
    margin:0;
    padding:0;
    height:20px;
    font-size:12px;
}
-->
</style>
</head>

<body class="curveBody">
 <center><a href="/admin/is.jsp">返回管理界面</a></center>

<br><br>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td height="20"><div align="center" id="curve"></div></td></tr>
</table>

<form  method="post" name="form2">

<%
String nian = request.getParameter("nian") == null || request.getParameter("nian") =="" ? "2009" : request.getParameter("nian");

%>
<input type="text" name="nian"  value="2009">
<input type="submit" value="搜索"> 年份格式 2009
<p>显示年份为 [<strong><%=nian %></strong>]的每个月的详细情况</p>
</form>
</body>
<script language="javascript">
<!--
function VMLCurve(objDiv){
    。。。。。。。。
 }

// Init
VMLCurve.prototype.init = function(strObj,strTitle){
    
    this.gpcX            = this.gpWidth/this.n;            // coordsize X
    this.gpcY            = this.gpHeight/this.n;            // coordsize Y
    
    this.configXLen          = this.gpWidth - this.configYLeft*2+20;    // 定义 X轴长度
    this.configYLen          = this.gpHeight- 100;            // 定义 Y 轴长度
    this.configXNum        = this.configXValue.length;        // X轴刻度数
    this.configYNum        = this.configYValue.length;        // Y轴刻度数
    
    this.configXTop        = this.configYLen+20;            //定义 X轴距对象上边的距离
    
    this.configXPerLen    = str2Float((this.configXLen-20)/this.configXNum,2); //定义 X轴每刻度长度
    this.configYPerLen    = str2Float((this.configYLen-20)/this.configYNum,2); //定义 Y轴每刻度长度

    
    //初始化背景参数
    this.bgWidth        = this.gpWidth;        // Height
    this.bgHeight        = this.gpHeight;    // Width
    
    if(this.configYPerValue!=0){ 
        var tempArr = new Array(this.configYNum);
        for(var i=0;i<this.configYNum;i++){
            tempArr[i] = str2Float(this.configYMinValue+this.configYPerValue*i,2);
        }
        this.configYValue = tempArr; 
    }
    else {
        this.configYPerValue = str2Float((this.configYValue(this.configYNum)-this.configYMinValue)/this.configYNum,2); 
    } 
    
   if(this.configXPerValue!=0){ 
        var tempArr = new Array(this.configXNum);
        for(var i=0;i<this.configXNum;i++){
            tempArr[i] = str2Float(this.configXMinValue+this.configXPerValue*i,2);
        }
        this.configXValue = tempArr;  
    }else{
         //this.configXPerValue = str2Float((this.configXValue(this.configXNum)-this.configXMinValue)/this.configXNum,2); 
    } 
    
    。。。。。。。}

//建立画图区域
VMLCurve.prototype.createGroup = function() {
    this.group = document.createElement("<v:group ID=\"group1\" coordsize=\""+this.gpcX+","+this.gpcY+"\" style=\"z-index:-10;width:"+this.gpWidth+"px;height:"+this.gpHeight+"px\">");
    this.objDiv.insertBefore(this.group);
}

//填充背景
VMLCurve.prototype.createBackgroud = function() {
    this.Background = document.createElement("<v:rect fillcolor=\"white\" strokecolor=\"black\" style=\"z-index:-8;width:"+this.bgWidth+"px;height:"+this.bgHeight+"px\" />");
    this.Background.insertBefore(document.createElement("<v:fill rotate=\"t\" type=\"gradient\" color2=\""+this.bgColor+"\" />"));
    this.Background.insertBefore(document.createElement("<v:shadow on=\"t\" type=\"single\" color=\"silver\" offset=\"3pt,3pt\" />"));
    this.group.insertBefore(this.Background);
}

//建立坐标轴
VMLCurve.prototype.createCoordinate = function() {
    var pointX1 = this.configYLeft + "," + this.configXTop;
    var pointX2 = this.configYLeft+this.configXLen + "," + this.configXTop;
    var pointY1 = pointX1;
    var pointY2 = this.configYLeft + "," + eval(this.configXTop-this.configYLen);
    this.createCoordinateLine(pointY1,pointX2);
    this.createCoordinateLine(pointY1,pointY2);
    this.setOriginValue(this.OriginXValue,this.OriginYValue);
}

//建立坐标线
VMLCurve.prototype.createTableLine = function(xPoint,yPoint,sTableColor){
    var tempLine = document.createElement("<v:line from=\""+xPoint+"\" to=\""+yPoint+"\" strokeColor=\""+sTableColor+"\" style=\"Z-INDEX:8;POSITION:absolute;/>");
    this.group.insertBefore(tempLine);
    tempLine.insertBefore(document.createElement("<v:stroke dashstyle=\"Solid\" />"));
}

//画坐标轴线
VMLCurve.prototype.createCoordinateLine = function(xPoint,yPoint){
    var tempLine = document.createElement("<v:line from=\""+xPoint+"\" to=\""+yPoint+"\" strokeColor=\"#FF6600\" strokeweight=\"1px\" style=\"Z-INDEX:8;POSITION:absolute;\"/>");
    this.group.insertBefore(tempLine);
    tempLine.insertBefore(document.createElement("<v:stroke  EndArrow=\"classic\" />"));
}

//创建文本提示信息
VMLCurve.prototype.createText = function(xLeft,xTop,sText,sClass) {
    var tempObj = document.createElement("<P class=\""+sClass+"\" style=\"Z-INDEX:8;LEFT:"+xLeft+"px;POSITION:absolute;TOP:"+xTop+"px;\"/>");
    tempObj.innerHTML = sText;
    this.group.insertBefore(tempObj);
}

// 创建X坐标网格线
VMLCurve.prototype.createXTableLine = function(){
    var x1,y1,x2,y2,point1,point2,sTableColor;
    sTableColor = "#CCCCCC";
    for(var i=0;i<this.configXValue.length;i++){
        x1 = eval(this.configYLeft + this.configXPerLen*(i+1));
        y1 = eval(this.configXTop-this.configYLen)+10;
        x2 = x1;
        y2 = eval(this.configXTop+5);
        point1 = x1 + "," + y1; 
        point2 = x2 + "," + y2;
        this.createTableLine(point1,point2,sTableColor);
        this.createText(x1+this.configXTextLeft,this.configXTop+this.configXTextTop,this.configXValue[i],"pBlack");
    }
}

//创建Y轴坐标网格线
VMLCurve.prototype.createYTableLine = function(){
    var x1,y1,x2,y2,point1,point2,sTableColor;
    for(var i=0;i<this.configYValue.length;i++){
        x1 = eval(this.configYLeft - 5);
        y1 = eval(this.configXTop - this.configYPerLen*(i+1));
        x2 = eval(this.configYLeft + this.configXLen - 10);
        y2 = y1;
        point1 = x1 + "," + y1; 
        point2 = x2 + "," + y2;
        if(this.configYValue[this.configYValue.length-i-1]=="C2") sTableColor="#FF9900";
        else sTableColor = "#CCCCCC";
        this.createTableLine(point1,point2,sTableColor);
        this.createText(this.configYLeft-this.configYTextRight,y1-this.configYTextBottom,this.configYValue[this.configYValue.length-i-1],"pBlack");
    }
}


//设置标题
VMLCurve.prototype.setTitle = function(strTitle){
    var tempObj = document.createElement("<div class=\"Title\" style=\"POSITION:absolute;Z-INDEX:9;LEFT:"+40+"px;TOP:"+(this.configXTop+40)+"px;width:"+(this.configXLen)+"px;height:"+(this.gpHeight-this.configXTop-20)+";/>");
    tempObj.innerHTML = strTitle;
    this.group.insertBefore(tempObj);
}

// 画圆点坐标
VMLCurve.prototype.setOriginValue = function(x,y){
    this.createText(this.configYLeft+this.configXTextLeft,this.configXTop+this.configXTextTop,x,"pBlack");
    this.createText(this.configYLeft-this.configYTextRight,this.configXTop-this.configYTextBottom,y,"pBlack");
}


// 设置圆点坐标属性
VMLCurve.prototype.setPointsProp = function(sPointRadius,sLineSize,sPointColor,sLineColor){
    PointRadius = sPointRadius;         //圆点的半径大小
    LineSize    = sLineSize;              //线的大小
    PointColor  = sPointColor;            //点的颜色
    LineColor   = sLineColor;            //线的颜色
}


// 设置纵坐标的值
VMLCurve.prototype.setPointsValue = function(xValueArr,yValueArr,sValueArr){
    var sValue  = "";
    var xValue  = 0;
    var yValue  = 0;
。。。。。。。。。。。}


// create Point
VMLCurve.prototype.createPoint = function(sLeft,sTop,sText){
。。。。。。。。。。。。。}

//以两点为坐标画线
VMLCurve.prototype.createCurveLine = function(){
    。。。。。。。。。。。}


VMLCurve.prototype.createToolTip = function(){
    this.group.insertBefore(this.ToolTip);
}

VMLCurve.prototype.setToolTip = function(sVisitable,sContent,x,y){
    。。。。。。。。。。。}
function str2Float(as_str,ai_digit,as_type)
{
   var fdb_tmp = 0;
   var fi_digit = 0;
   var fs_digit = "1";
   var fs_str = "" + as_str;
   var fs_tmp1 = "";
   var fs_tmp2 = "";
   var fi_pos = 0;
   var fi_len = 0;
   fdb_tmp = parseFloat(isNaN(parseFloat(fs_str))?0:fs_str);
   
   switch (true)
   {
     。。。。。。。。。。。   }
   return fdb_tmp;
} 
//-->
</script>

<script language="javascript">
...........
</script>

</html>