参照 http://hi.baidu.com/nkiqzedjqwadpre/item/75dc612087b1530877272c4d ,自己稍微改进了一下。
代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HCXYPlanTB1.aspx.cs" Inherits="Modules_Plan_HCXYPlanTB1" %>
<!-- 代码开始===========================================-->
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<!--[if !mso]>
<style>
v\:* { behavior: url(#default#VML) }
o\:* { behavior: url(#default#VML) }
.shape { behavior: url(#default#VML) }
</style>
<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312" />
<title></title>
<style type="text/css">
TD
{ FONT-SIZE: 9pt}
</style>
<script language="javascript" type="text/javascript">
function table2(total,table_x,table_y,all_width,all_height,line_no)
{
//参数含义(传递的数组,横坐标,纵坐标,图表的宽度,图表的高度,折线条数)
//生成图表函数2——折线图
var line_color = "#69f";
var left_width = 70;
var total_no = total[1].length
var temp1,temp2,temp3
temp1 = 0;
for(var i=1;i<total_no;i++)
{
for(var j=1;j<=line_no;j++)
{
if(temp1<total[j][i])
temp1 = total[j][i];
}
}
temp1 = parseInt(temp1);
if(temp1>9)
{
temp2 = temp1.toString().substr(1,1);
if(temp2>4)
{
temp3 = (temp1/(Math.pow(10,(temp1.toString().length-1)))+1)*Math.pow(10,(temp1.toString().length-1));
}
else
{
temp3 = (temp1/(Math.pow(10,(temp1.toString().length-1)))+0.5)*Math.pow(10,(temp1.toString().length-1));
}
}
else
{
if(temp1>4)
{
temp3 = 10;
}
else
{
temp3 = 5;
}
}
temp4 = temp3;
document.write("<v:rect id='_x0000_s1027' alt='' style='position:absolute;left:" + (table_x + left_width) + "px;top:" + table_y + "px;width:" + all_width + "px;height:" + all_height + "px;z-index:-1' fillcolor='#9cf' stroked='f'><v:fill rotate='t' angle='-45' focus='100%' type='gradient'/></v:rec