方法一 <%dim total(7,3)
total(1,0)="中国经营报"
total(2,0)="招聘网"
total(3,0)="51Job"
total(4,0)="新民晚报"
total(5,0)="新闻晚报"
total(6,0)="南方周末"
total(7,0)="羊城晚报"
total(0,1)="#FF0000,1.5,1,2,公司1"'参数1线条的颜色,参数2线条的宽度,参数3线条的类型,参数4转折点的类型,参数5线条名称
total(1,1)=200
total(2,1)=1200
total(3,1)=900
total(4,1)=600
total(5,1)=1222
total(6,1)=413
total(7,1)=800
total(0,2)="#0000FF,1,2,3,公司2"
total(1,2)=400
total(2,2)=500
total(3,2)=1040
total(4,2)=1600
total(5,2)=522
total(6,2)=813
total(7,2)=980
total(0,3)="#004D00,1,1,3,公司3"
total(1,3)=900
total(2,3)=890
total(3,3)=1240
total(4,3)=1300
total(5,3)=722
total(6,3)=833
total(7,3)=1280
%><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>
TD { FONT-SIZE: 9pt}
</style></head>
<body topmargin=5 leftmargin=0 scroll=AUTO>
<%call table2(total,100,90,600,250,3)%>
</body>
</html>
<%
function table2(total,table_x,table_y,all_width,all_height,line_no)
'参数含义(传递的数组,横坐标,纵坐标,图表的宽度,图表的高度,折线条数)
'纯ASP代码生成图表函数2——折线图
'作者:龚鸣(Passwordgm) QQ:25968152 MSN:passwordgm@sina.com Email:passwordgm@sina.com
'本人非常愿意和ASP,VML,FLASH的爱好者在HTTP://topclouds.126.com进行交流和探讨
'版本1.0 最后修改日期 2003-8-11
'非常感谢您使用这个函数,请您使用和转载时保留版权信息,这是对作者工作的最好的尊重。
line_color="#69f"
left_width=70
total_no=ubound(total,1)
temp1=0
for i=1 to total_no
for j=1 to line_no
if temp1<total(i,j) then temp1=total(i,j)
next
next
temp1=int(temp1)
if temp1>9 then
temp2=mid(cstr(temp1),2,1)
if temp2>4 then
temp3=(int(temp1/(10^(len(cstr(temp1))-1)))+1)*10^(len(cstr(temp1))-1)
else
temp3=(int(temp1/(10^(len(cstr(temp1))-1)))+0.5)*10^(len(cstr(temp1))-1)
end if
else
if temp1>4 then temp3=10 else temp3=5
end if
temp4=temp3
response.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:rect>"
for i=0 to all_height-1 step all_height/5
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+left_width+length&"px,"&table_y+all_height-length-i&"px' to='"&table_x+all_width+left_width&"px,"&table_y+all_height-length-i&"px' strokecolor='"&line_color&"'/>"
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+(left_width-15)&"px,"&table_y+i&"px' to='"&table_x+left_width&"px,"&table_y+i&"px'/>"
response.write ""
response.write "<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:"&table_x&"px;top:"&table_y+i&"px;width:"&left_width&"px;height:18px;z-index:1'>"
response.write "<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='right'>"&temp4&"</td></tr></table></v:textbox></v:shape>"
temp4=temp4-temp3/5
next
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+left_width&"px,"&table_y+all_height&"px' to='"&table_x+all_width+left_width&"px,"&table_y+all_height&"px'/>"
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+left_width&"px,"&table_y&"px' to='"&table_x+left_width&"px,"&table_y+all_height&"px'/>"
dim line_code
redim line_code(line_no,5)
for i=1 to line_no
line_temp=split(total(0,i),",")
line_code(i,1)=line_temp(0)
line_code(i,2)=line_temp(1)
line_code(i,3)=line_temp(2)
line_code(i,4)=line_temp(3)
line_code(i,5)=line_temp(4)
next
for j=1 to line_no
for i=1 to total_no-1
x1=table_x+left_width+all_width*(i-1)/total_no
y1=table_y+(temp3-total(i,j))*(all_height/temp3)
x2=table_x+left_width+all_width*i/total_no
y2=table_y+(temp3-total(i+1,j))*(all_height/temp3)
response.write "<v:line id=""_x0000_s1025"" alt="""" style='position:absolute;left:0;text-align:left;top:0;z-index:1' from="""&x1&"px,"&y1&"px"" to="""&x2&"px,"&y2&"px"" coordsize=""21600,21600"" strokecolor="""&line_code(j,1)&""" strokeweight="""&line_code(j,2)&""">"
select case line_code(j,3)
case 1
case 2
response.write "<v:stroke dashstyle='1 1'/>"
case 3
response.write "<v:stroke dashstyle='dash'/>"
case 4
response.write "<v:stroke dashstyle='dashDot'/>"
case 5
response.write "<v:stroke dashstyle='longDash'/>"
case 6
response.write "<v:stroke dashstyle='longDashDot'/>"
case 7
response.write "<v:stroke dashstyle='longDashDotDot'/>"
case else
end select
response.write "</v:line>"&CHR(13)
select case line_code(j,4)
case 1
case 2
response.write "<v:rect id=""_x0000_s1027"" style='position:absolute;left:"&x1-2&"px;top:"&y1-2&"px;width:4px;height:4px; z-index:2' fillcolor="""&line_code(j,1)&""" strokecolor="""&line_code(j,1)&"""/>"&CHR(13)
case 3
response.write "<v:oval id=""_x0000_s1026"" style='position:absolute;left:"&x1-2&"px;top:"&y1-2&"px;width:4px;height:4px;z-index:1' fillcolor="""&line_code(j,1)&""" strokecolor="""&line_code(j,1)&"""/>"&CHR(13)
end select
next
select case line_code(j,4)
case 1
case 2
response.write "<v:rect id=""_x0000_s1027"" style='position:absolute;left:"&x2-2&"px;top:"&y2-2&"px;width:4px;height:4px; z-index:2' fillcolor="""&line_code(j,1)&""" strokecolor="""&line_code(j,1)&"""/>"&CHR(13)
case 3
response.write "<v:oval id=""_x0000_s1026"" style='position:absolute;left:"&x2-2&"px;top:"&y2-2&"px;width:4px;height:4px;z-index:1' fillcolor="""&line_code(j,1)&""" strokecolor="""&line_code(j,1)&"""/>"&CHR(13)
end select
next
for i=1 to total_no
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+left_width+all_width*(i-1)/total_no&"px,"&table_y+all_height&"px' to='"&table_x+left_width+all_width*(i-1)/total_no&"px,"&table_y+all_height+15&"px'/>"
response.write ""
response.write "<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:"&table_x+left_width+all_width*(i-1)/total_no&"px;top:"&table_y+all_height&"px;width:"&all_width/total_no&"px;height:18px;z-index:1'>"
response.write "<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'>"&total(i,0)&"</td></tr></table></v:textbox></v:shape>"
next
tb_height=30
response.write "<v:rect id='_x0000_s1025' style='position:absolute;left:"&table_x+all_width+20&"px;top:"&table_y&"px;width:100px;height:"&line_no*tb_height+20&"px;z-index:1'/>"
for i=1 to line_no
response.write "<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:"&table_x+all_width+25&"px;top:"&table_y+10+(i-1)*tb_height&"px;width:60px;height:"&tb_height&"px;z-index:1'>"
response.write "<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'>"&line_code(i,5)&"</td></tr></table></v:textbox></v:shape>"
response.write "<v:rect id='_x0000_s1040' alt='' style='position:absolute;left:"&table_x+all_width+80&"px;top:"&table_y+10+(i-1)*tb_height+4&"px;width:30px;height:20px;z-index:1' fillcolor='"&line_code(i,1)&"'><v:fill color2='"&line_code(i,1)&"' rotate='t' focus='100%' type='gradient'/></v:rect>"
next
end function
%>
方法二:
<%
'不要修改以下数据,除非你知道你在做什么
'#####################################
Height=200 '//图表高度
Width=600 '//图表宽度
posX=390-Width/2 '//相对浏览器的X位置
posY=70 '//相对浏览器的Y位置
scaleX=50 '//最好为Width值的倍数
scaleY=50 '//最好为Height值的倍数
countX=Cint(Width/scaleX)
countY=Cint(Height/scaleY)
data="50,50|100,120|200,150|300,50|450,100" '//要输入折线的点阵(竖线分隔每个组,逗号分隔每个组中的X和Y值)
TempData=Split(data,"|")
TempDataCount=UBound(TempData)+1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--Coding By PYPStudio-->
<title>折线图生成</title>
<style type="text/css">
<!--
.upperLine {
border-bottom-width: 1px;
border-top-style: none;
border-right-style: none;
border-bottom-style: solid;
border-left-style: none;
border-bottom-color: #FF0000;
}
-->
</style>
</head>
<body>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="1" class="upperLine">
<tr>
<td height="30" align="center"><h2><strong>折线图标题</strong></h2></td>
</tr>
</table>
<!--生成折线图开始-->
<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]-->
<style>
TD { FONT-SIZE: 9pt}
</style>
<!--总体框架-->
<v:rect style='position:absolute;left:<%=posX%>px;top:<%=posY%>px;width:<%=Width%>px;height:<%=Height%>px;z-index:-1' fillcolor='#9cf' stroked='f'>
<v:fill rotate='t' angle='-45' focus='100%' />
</v:rect>
<!--X轴-->
<v:line style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='<%=posX%>px,<%=posY+Height%>px' to='<%=posX+Width%>px,<%=posY+Height%>px'/>
<!--Y轴-->
<v:line style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='<%=posX%>px,<%=posY%>px' to='<%=posX%>px,<%=posY+Height%>px'/>
<!--X轴刻度-->
<% For i=1 to countX+1 %>
<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='<%=posX+(i-1)*scaleX%>px,<%=posY+Height%>px' to='<%=posX+(i-1)*scaleX%>px,<%=posY+Height+5%>px' strokecolor='#000000'/>
<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:<%=posX+(i-1)*scaleX-10%>px;top:<%=posY+Height+5%>px;width:70px;height:18px;z-index:1'>
<v:textbox inset='0px,0px,0px,0px'>
<table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'><%=(i-1)*scaleX%></td></tr></table>
</v:textbox>
</v:shape>
<% Next %>
<!--Y轴刻度-->
<% For i=1 to countY+1 %>
<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='<%=posX-5%>px,<%=posY+Height-(i-1)*scaleY%>px' to='<%=posX+Width%>px,<%=posY+Height-(i-1)*scaleY%>px' strokecolor='#000000'/>
<% if i<>1 then %>
<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:<%=posX-30%>px;top:<%=posY+Height-(i-1)*scaleY-10%>px;width:70px;height:18px;z-index:1'>
<v:textbox inset='0px,0px,0px,0px'>
<table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'><%=(i-1)*scaleY%></td></tr></table>
</v:textbox>
</v:shape>
<% End if %>
<% Next %>
<!--画点连线-->
<% For i=0 to TempDataCount %>
<% if i=0 then %>
<% showDataI=split(TempData(i),",") %>
<v:line style='position:absolute;left:0;text-align:left;top:0;z-index:1' from="<%=posX%>px,<%=posY+Height%>px" to="<%=posX+showDataI(0)%>px,<%=posY+Height-showDataI(1)%>px" coordsize="21600,21600" strokecolor="#FF0000" strokeweight="1.5"></v:line>
<% Else %>
<% showDataI=split(TempData(i-1),",") %>
<% If i<>TempDataCount then %>
<% showDataII=split(TempData(i),",") %>
<% Else %>
<% showDataII=split(TempData(i-1),",") %>
<% End if %>
<!--第 【<%=i%>】 条线-->
<v:oval style='position:absolute;left:<%=posX+showDataI(0)%>px;top:<%=posY+Height-showDataI(1)%>px;width:4px;height:4px;z-index:1' fillcolor="#FF0000" strokecolor="#FF0000"/>
<v:line style='position:absolute;left:0;text-align:left;top:0;z-index:1' from="<%=posX+showDataI(0)%>px,<%=posY+Height-showDataI(1)%>px" to="<%=posX+showDataII(0)%>px,<%=posY+Height-showDataII(1)%>px" coordsize="21600,21600" strokecolor="#FF0000" strokeweight="1.5"></v:line>
<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:<%=posX+showDataI(0)%>px;top:<%=posY+Height-showDataI(1)%>px;width:100px;height:18px;z-index:5'>
<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'>(<%=showDataI(0)%>,<%=showDataI(1)%>)</td></tr></table>
</v:textbox>
</v:shape>
<% End if %>
<% Next %>
</body>
</html>
total(1,0)="中国经营报"
total(2,0)="招聘网"
total(3,0)="51Job"
total(4,0)="新民晚报"
total(5,0)="新闻晚报"
total(6,0)="南方周末"
total(7,0)="羊城晚报"
total(0,1)="#FF0000,1.5,1,2,公司1"'参数1线条的颜色,参数2线条的宽度,参数3线条的类型,参数4转折点的类型,参数5线条名称
total(1,1)=200
total(2,1)=1200
total(3,1)=900
total(4,1)=600
total(5,1)=1222
total(6,1)=413
total(7,1)=800
total(0,2)="#0000FF,1,2,3,公司2"
total(1,2)=400
total(2,2)=500
total(3,2)=1040
total(4,2)=1600
total(5,2)=522
total(6,2)=813
total(7,2)=980
total(0,3)="#004D00,1,1,3,公司3"
total(1,3)=900
total(2,3)=890
total(3,3)=1240
total(4,3)=1300
total(5,3)=722
total(6,3)=833
total(7,3)=1280
%><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>
TD { FONT-SIZE: 9pt}
</style></head>
<body topmargin=5 leftmargin=0 scroll=AUTO>
<%call table2(total,100,90,600,250,3)%>
</body>
</html>
<%
function table2(total,table_x,table_y,all_width,all_height,line_no)
'参数含义(传递的数组,横坐标,纵坐标,图表的宽度,图表的高度,折线条数)
'纯ASP代码生成图表函数2——折线图
'作者:龚鸣(Passwordgm) QQ:25968152 MSN:passwordgm@sina.com Email:passwordgm@sina.com
'本人非常愿意和ASP,VML,FLASH的爱好者在HTTP://topclouds.126.com进行交流和探讨
'版本1.0 最后修改日期 2003-8-11
'非常感谢您使用这个函数,请您使用和转载时保留版权信息,这是对作者工作的最好的尊重。
line_color="#69f"
left_width=70
total_no=ubound(total,1)
temp1=0
for i=1 to total_no
for j=1 to line_no
if temp1<total(i,j) then temp1=total(i,j)
next
next
temp1=int(temp1)
if temp1>9 then
temp2=mid(cstr(temp1),2,1)
if temp2>4 then
temp3=(int(temp1/(10^(len(cstr(temp1))-1)))+1)*10^(len(cstr(temp1))-1)
else
temp3=(int(temp1/(10^(len(cstr(temp1))-1)))+0.5)*10^(len(cstr(temp1))-1)
end if
else
if temp1>4 then temp3=10 else temp3=5
end if
temp4=temp3
response.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:rect>"
for i=0 to all_height-1 step all_height/5
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+left_width+length&"px,"&table_y+all_height-length-i&"px' to='"&table_x+all_width+left_width&"px,"&table_y+all_height-length-i&"px' strokecolor='"&line_color&"'/>"
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+(left_width-15)&"px,"&table_y+i&"px' to='"&table_x+left_width&"px,"&table_y+i&"px'/>"
response.write ""
response.write "<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:"&table_x&"px;top:"&table_y+i&"px;width:"&left_width&"px;height:18px;z-index:1'>"
response.write "<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='right'>"&temp4&"</td></tr></table></v:textbox></v:shape>"
temp4=temp4-temp3/5
next
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+left_width&"px,"&table_y+all_height&"px' to='"&table_x+all_width+left_width&"px,"&table_y+all_height&"px'/>"
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+left_width&"px,"&table_y&"px' to='"&table_x+left_width&"px,"&table_y+all_height&"px'/>"
dim line_code
redim line_code(line_no,5)
for i=1 to line_no
line_temp=split(total(0,i),",")
line_code(i,1)=line_temp(0)
line_code(i,2)=line_temp(1)
line_code(i,3)=line_temp(2)
line_code(i,4)=line_temp(3)
line_code(i,5)=line_temp(4)
next
for j=1 to line_no
for i=1 to total_no-1
x1=table_x+left_width+all_width*(i-1)/total_no
y1=table_y+(temp3-total(i,j))*(all_height/temp3)
x2=table_x+left_width+all_width*i/total_no
y2=table_y+(temp3-total(i+1,j))*(all_height/temp3)
response.write "<v:line id=""_x0000_s1025"" alt="""" style='position:absolute;left:0;text-align:left;top:0;z-index:1' from="""&x1&"px,"&y1&"px"" to="""&x2&"px,"&y2&"px"" coordsize=""21600,21600"" strokecolor="""&line_code(j,1)&""" strokeweight="""&line_code(j,2)&""">"
select case line_code(j,3)
case 1
case 2
response.write "<v:stroke dashstyle='1 1'/>"
case 3
response.write "<v:stroke dashstyle='dash'/>"
case 4
response.write "<v:stroke dashstyle='dashDot'/>"
case 5
response.write "<v:stroke dashstyle='longDash'/>"
case 6
response.write "<v:stroke dashstyle='longDashDot'/>"
case 7
response.write "<v:stroke dashstyle='longDashDotDot'/>"
case else
end select
response.write "</v:line>"&CHR(13)
select case line_code(j,4)
case 1
case 2
response.write "<v:rect id=""_x0000_s1027"" style='position:absolute;left:"&x1-2&"px;top:"&y1-2&"px;width:4px;height:4px; z-index:2' fillcolor="""&line_code(j,1)&""" strokecolor="""&line_code(j,1)&"""/>"&CHR(13)
case 3
response.write "<v:oval id=""_x0000_s1026"" style='position:absolute;left:"&x1-2&"px;top:"&y1-2&"px;width:4px;height:4px;z-index:1' fillcolor="""&line_code(j,1)&""" strokecolor="""&line_code(j,1)&"""/>"&CHR(13)
end select
next
select case line_code(j,4)
case 1
case 2
response.write "<v:rect id=""_x0000_s1027"" style='position:absolute;left:"&x2-2&"px;top:"&y2-2&"px;width:4px;height:4px; z-index:2' fillcolor="""&line_code(j,1)&""" strokecolor="""&line_code(j,1)&"""/>"&CHR(13)
case 3
response.write "<v:oval id=""_x0000_s1026"" style='position:absolute;left:"&x2-2&"px;top:"&y2-2&"px;width:4px;height:4px;z-index:1' fillcolor="""&line_code(j,1)&""" strokecolor="""&line_code(j,1)&"""/>"&CHR(13)
end select
next
for i=1 to total_no
response.write "<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='"&table_x+left_width+all_width*(i-1)/total_no&"px,"&table_y+all_height&"px' to='"&table_x+left_width+all_width*(i-1)/total_no&"px,"&table_y+all_height+15&"px'/>"
response.write ""
response.write "<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:"&table_x+left_width+all_width*(i-1)/total_no&"px;top:"&table_y+all_height&"px;width:"&all_width/total_no&"px;height:18px;z-index:1'>"
response.write "<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'>"&total(i,0)&"</td></tr></table></v:textbox></v:shape>"
next
tb_height=30
response.write "<v:rect id='_x0000_s1025' style='position:absolute;left:"&table_x+all_width+20&"px;top:"&table_y&"px;width:100px;height:"&line_no*tb_height+20&"px;z-index:1'/>"
for i=1 to line_no
response.write "<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:"&table_x+all_width+25&"px;top:"&table_y+10+(i-1)*tb_height&"px;width:60px;height:"&tb_height&"px;z-index:1'>"
response.write "<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'>"&line_code(i,5)&"</td></tr></table></v:textbox></v:shape>"
response.write "<v:rect id='_x0000_s1040' alt='' style='position:absolute;left:"&table_x+all_width+80&"px;top:"&table_y+10+(i-1)*tb_height+4&"px;width:30px;height:20px;z-index:1' fillcolor='"&line_code(i,1)&"'><v:fill color2='"&line_code(i,1)&"' rotate='t' focus='100%' type='gradient'/></v:rect>"
next
end function
%>
方法二:
<%
'不要修改以下数据,除非你知道你在做什么
'#####################################
Height=200 '//图表高度
Width=600 '//图表宽度
posX=390-Width/2 '//相对浏览器的X位置
posY=70 '//相对浏览器的Y位置
scaleX=50 '//最好为Width值的倍数
scaleY=50 '//最好为Height值的倍数
countX=Cint(Width/scaleX)
countY=Cint(Height/scaleY)
data="50,50|100,120|200,150|300,50|450,100" '//要输入折线的点阵(竖线分隔每个组,逗号分隔每个组中的X和Y值)
TempData=Split(data,"|")
TempDataCount=UBound(TempData)+1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--Coding By PYPStudio-->
<title>折线图生成</title>
<style type="text/css">
<!--
.upperLine {
border-bottom-width: 1px;
border-top-style: none;
border-right-style: none;
border-bottom-style: solid;
border-left-style: none;
border-bottom-color: #FF0000;
}
-->
</style>
</head>
<body>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="1" class="upperLine">
<tr>
<td height="30" align="center"><h2><strong>折线图标题</strong></h2></td>
</tr>
</table>
<!--生成折线图开始-->
<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]-->
<style>
TD { FONT-SIZE: 9pt}
</style>
<!--总体框架-->
<v:rect style='position:absolute;left:<%=posX%>px;top:<%=posY%>px;width:<%=Width%>px;height:<%=Height%>px;z-index:-1' fillcolor='#9cf' stroked='f'>
<v:fill rotate='t' angle='-45' focus='100%' />
</v:rect>
<!--X轴-->
<v:line style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='<%=posX%>px,<%=posY+Height%>px' to='<%=posX+Width%>px,<%=posY+Height%>px'/>
<!--Y轴-->
<v:line style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='<%=posX%>px,<%=posY%>px' to='<%=posX%>px,<%=posY+Height%>px'/>
<!--X轴刻度-->
<% For i=1 to countX+1 %>
<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='<%=posX+(i-1)*scaleX%>px,<%=posY+Height%>px' to='<%=posX+(i-1)*scaleX%>px,<%=posY+Height+5%>px' strokecolor='#000000'/>
<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:<%=posX+(i-1)*scaleX-10%>px;top:<%=posY+Height+5%>px;width:70px;height:18px;z-index:1'>
<v:textbox inset='0px,0px,0px,0px'>
<table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'><%=(i-1)*scaleX%></td></tr></table>
</v:textbox>
</v:shape>
<% Next %>
<!--Y轴刻度-->
<% For i=1 to countY+1 %>
<v:line id='_x0000_s1027' alt='' style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1' from='<%=posX-5%>px,<%=posY+Height-(i-1)*scaleY%>px' to='<%=posX+Width%>px,<%=posY+Height-(i-1)*scaleY%>px' strokecolor='#000000'/>
<% if i<>1 then %>
<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:<%=posX-30%>px;top:<%=posY+Height-(i-1)*scaleY-10%>px;width:70px;height:18px;z-index:1'>
<v:textbox inset='0px,0px,0px,0px'>
<table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'><%=(i-1)*scaleY%></td></tr></table>
</v:textbox>
</v:shape>
<% End if %>
<% Next %>
<!--画点连线-->
<% For i=0 to TempDataCount %>
<% if i=0 then %>
<% showDataI=split(TempData(i),",") %>
<v:line style='position:absolute;left:0;text-align:left;top:0;z-index:1' from="<%=posX%>px,<%=posY+Height%>px" to="<%=posX+showDataI(0)%>px,<%=posY+Height-showDataI(1)%>px" coordsize="21600,21600" strokecolor="#FF0000" strokeweight="1.5"></v:line>
<% Else %>
<% showDataI=split(TempData(i-1),",") %>
<% If i<>TempDataCount then %>
<% showDataII=split(TempData(i),",") %>
<% Else %>
<% showDataII=split(TempData(i-1),",") %>
<% End if %>
<!--第 【<%=i%>】 条线-->
<v:oval style='position:absolute;left:<%=posX+showDataI(0)%>px;top:<%=posY+Height-showDataI(1)%>px;width:4px;height:4px;z-index:1' fillcolor="#FF0000" strokecolor="#FF0000"/>
<v:line style='position:absolute;left:0;text-align:left;top:0;z-index:1' from="<%=posX+showDataI(0)%>px,<%=posY+Height-showDataI(1)%>px" to="<%=posX+showDataII(0)%>px,<%=posY+Height-showDataII(1)%>px" coordsize="21600,21600" strokecolor="#FF0000" strokeweight="1.5"></v:line>
<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:<%=posX+showDataI(0)%>px;top:<%=posY+Height-showDataI(1)%>px;width:100px;height:18px;z-index:5'>
<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'>(<%=showDataI(0)%>,<%=showDataI(1)%>)</td></tr></table>
</v:textbox>
</v:shape>
<% End if %>
<% Next %>
</body>
</html>
发表评论
-
iis错误Server Application Error的解决方法(附修复工具下载) .
2013-06-03 12:30 0http://blog.csdn.net/xys_777/ar ... -
多语言的网站
2012-11-26 10:33 7071,在数据库级别支持多 ... -
关于charset问题
2012-11-26 09:48 1146找到了这方面的资料。 ... -
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
2012-11-26 09:45 2478META,网页Html语言里Head区重要标签之一 HTTP ... -
xml生成
2011-08-08 14:11 992原XML文件; <?xml version=" ... -
ASP生成XML动态数据读取代码实例
2011-08-08 13:55 964<!--#include file="M_co ... -
ASP木马Webshell安全解决办案
2007-12-29 10:31 1031ASP木马、Webshell之安全防范解决办法正文内容: ... -
纯ASP结合VML生成完美图-折线图
2007-12-08 13:44 30方法一 <%dim total(7,3) t ... -
Aspupload组件使用实例代码
2007-11-04 00:03 1896bar.asp <%@EnableSessionSt ... -
ASP17种正则表达式 asp 的网页代理 把 ip 转换为整数
2007-11-04 00:01 2117ASP17种正则表达式 "^\\d+$" ...
相关推荐
本文将深入探讨如何使用ASP读取MDB(Microsoft Access)数据库中的数据,并利用VML(Vector Markup Language)生成折线图。 首先,我们需要了解ASP与MDB数据库的交互。ASP是微软提供的一种服务器端脚本技术,它允许...
在本示例中,ASP被用来处理和解析来自数据库或其他数据源的数据,然后使用VML(Vector Markup Language)来生成各种图表,如饼图、柱图和折线图。 VML是一种基于XML的矢量图形语言,允许在网页上创建和显示复杂的...
5. **图形类型**:通过VML,可以生成多种图形,如直线、曲线、圆形、矩形等,还可以组合成更复杂的图表,如饼图、柱状图、折线图等,非常适合做数据分析和报表展示。 6. **浏览器兼容性**:虽然VML主要是为Internet...
4. **生成VML图形**:在ASP页面上直接绘制折线图,可以使用VML(Vector Markup Language),它是XML的一个子集,用于在IE浏览器中绘制矢量图形。创建一个`<v:shape>`元素并设置其坐标和样式属性。这需要一定的SVG或...
根据提供的信息,我们可以深入探讨如何使用ASP(Active Server Pages)来生成折线图,并解析代码中的关键部分。本文将详细解读代码逻辑、功能实现及应用情境。 ### ASP生成折线图概述 #### 1. 折线图简介 折线图是...
在ASP中,可以使用VBScript或JScript编写脚本,结合HTML和VML(Vector Markup Language)来创建折线图。VML是一种用于绘制矢量图形的XML方言,适合在网页上生成图形。首先,你需要创建一个VML形状的容器,然后定义...
在ASP(Active Server Pages)开发中,生成图表通常需要依赖外部组件或库,但通过纯ASP代码也可以实现这一功能,特别是在资源有限或者不希望引入额外依赖的情况下。这种技术主要利用了VML(Vector Markup Language)...
在这个"ASP无组件折线图源码"中,我们讨论的是如何在ASP页面上生成折线图,而无需额外的图形组件。这通常是通过使用VBS(Visual Basic Script)和HTML来实现的。 折线图是一种常见的数据可视化工具,它通过连接一...
这个控件集提供了一套丰富的图表类型,包括折线图(即曲线图),可以方便地在ASP.NET应用中使用。虽然标题和描述中没有明确指出使用的是ASP.NET,但在ASP领域讨论曲线图生成时,ASP.NET是更常见且功能更强大的选择。...
此段代码主要展示了如何利用ASP结合VML(Vector Markup Language)来生成折线图的过程。 ### ASP简介 ASP是一种服务器端脚本环境,在HTML页面中可以嵌入各种脚本语言(如VBScript或JScript),通过这些脚本可以生成...
比如,要绘制一个简单的折线图,我们可以创建一系列的线段(line)元素,每个线段代表数据点之间的连接。每个线段的起点和终点由数据值决定。 ```xml ,100" filled="f"> ``` 在这个例子中,`data`属性定义了折线...
它能够以SVG(在现代浏览器中)或VML(在旧版IE中)格式绘制图表,支持多种图表类型,如柱状图、折线图、饼图、散点图等。在ASP.NET开发中,Highcharts是一个常用的工具,可以方便地集成到网页中,用于展示数据报表...
它提供超过100种不同类型的图表,如柱状图、折线图、饼图、地图等,能够以2D和3D形式呈现数据,使得数据报告和分析更加直观易懂。此外,FusionCharts还支持SVG和VML渲染,确保在所有现代浏览器及IE6-8中都能正常工作...
折线图、面积图、柱形图等图形可以通过一个简单的配置转换成极地图、雷达图。 inverted图表或坐标轴反转 Highcharts 支持图表反转(X 轴或 Y轴对调),这样 X轴是垂直的,方便进行数据对比;坐标轴旋转则可以坐标轴...
Highstock 支持直线图、折线图、面积图、面积曲线图、柱形图、散点图、蜡烛图(OHLC)、K线图、标签图、面积范围图、柱形范围图等多种图表, 其中很多图表可以集成在同一个图形中形成混合图 config-syntax简单的...
Highcharts支持多种图表类型,包括但不限于:柱状图、折线图、曲线图、区域图、饼图、散点图等。并且这些图表类型可以组合在同一张图表中,以满足复杂的数据可视化需求。 **2.6 简单的配置语法** Highcharts采用了...