< !-- #include file="adoconn.asp" -->
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title>曲线统计</title>
<STYLE>
v\:* { Behavior: url(#default#VML) }
o\:* { behavior: url(#default#VML) }
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
var showit = new Array(10);
function moveon(iteam,lineit){
temp=eval(iteam)
templine=eval(lineit)
if(showit[1]){
rec1.style.display = "";
line_1.style.display = "";
}else{
rec1.style.display = "none";
line_1.style.display = "none";
}
temp.style.display = "";
templine.style.display = "";
}
function moveout(iteam,lineit,i){
temp=eval(iteam)
templine=eval(lineit)
if (showit[i]){
temp.style.display = "";
templine.style.display = "";
}else{
temp.style.display = "none";
templine.style.display = "none";
}
}
function clickit(i){
if (showit[i]){
showit[i]=false
}else{
showit[i]=true
}
}
-->
</script>
</head>
<body>
< %
'''''''''''''''''''''''''''''''''''''''''''''
' 功能:asp读取数据库中数据生成统计折线图
' 开发:wangsdong
' 地址:www.
' 支持原创,保留此信息,谢谢
'''''''''''''''''''''''''''''''''''''''''''''
date1=cdate("2008-01-01 00:00:00")
date2=cdate("2008-12-31 23:59:59")
sql="select sum(m_value) as t,m_month from table1 where m_time>=#"&date1&"# and m_time<=#"&date2&"# group by m_month"
rs.open sql,conn,1,1
if rs.eof then
else
redim total(1,2)
s=""
v1=""
do while not rs.eof
s=s&","&rs("m_month")&"月"
v1=v1&","&rs("t")
rs.movenext
loop
total(0,1)=right(s,len(s)-1)
total(1,1)=right(v1,len(v1)-1)
total(1,2)="2008年业绩图"
end if
rs.close
set rs=nothing
call table1(total,20,20,700,350,"曲线统计图","时间","元")
% >
</body>
</html>
从网上找的,上面不要动,就把下面数据库中的数据转为自己的,不过我没有试验过