| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 501 人关注过本帖
标题:[求助]为什么生成的柱状图表,不是三条,我数据库里有三条记录(难!)
只看楼主 加入收藏
hbsxxmm
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-2-18
收藏
 问题点数:0 回复次数:0 
[求助]为什么生成的柱状图表,不是三条,我数据库里有三条记录(难!)
为什么生成的柱状图表,不是三条,我数据库里有三条记录
<!--#include file="../inc/conn.asp"-->
<!--#include file="function.asp"-->
<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) }
body { background:#FFFFFF; color:#333333; font-size: 12px; }
td { font-size: 12px}
select { font-size: 12px; border-width:1px}
span { font-size: 12px; position: static }
</style>
<![endif]-->
<head>
<%
action = Request.QueryString("action")
if action<>"draw" then
%>
<STYLE TYPE="text/css">
<!--
.p9{ font-size: 9pt; font-family: 宋体 }
td {font-size: 9pt}
.tx {height: 16px; width: 30px; border-color: black black #000000; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; font-size: 9pt; background-color: #eeeeee; color: #0000FF}
.tx2 {height: 16px;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; font-size: 9pt; color: #0000FF; border-left-color:#000000; border-right-color:#000000; border-top-color:#000000; border-bottom-color:#000000}
.bt {border-left:1px solid #C0C0C0; border-top:1px solid #C0C0C0; font-size: 9pt; border-right-width: 1; border-bottom-width: 1; height: 16px; width: 80px; background-color: #EEEEEE; cursor: hand; border-right-style:solid; border-bottom-style:solid}
.tx1 { width: 400 ;height: 20px; font-size: 9pt; border: 1px solid; border-color: black black #000000; color: #0000FF}
-->
</STYLE>
<SCRIPT LANGUAGE="vbscript">
function addfile()
dim str
str="<table BORDER=1><tr align='center'><td>No</td><td>项目*</td><td>数据*</td><td>颜色 (<b><u>#FF0000</u></b> 或 <b><u>red</u></b>)</td></tr>"
if not IsNumeric (window.form1.total_no.value) then window.form1.total_no.value =1
for i=1 to window.form1.total_no.value
str=str&"<tr align='center'><td>"&i&"</td><td><input name='csiItem' size='10' value='"&i&"月'></td><td><input name='csiData' size='10' value='"&i&"'></td><td><input name='csiColor' size='10'></td></tr>"
'str=str&"<tr align='center'><td>"&i&"</td><td><input name='csiItem"&i&"' size='10'></td><td><input name='csiData"&i&"' size='10'></td><td><input name='csiColor"&i&"' size='10'></td></tr>"
next
window.uptd.innerHTML =str&"</table>"
end function
</SCRIPT>
<%
end if
%>
<title>VML 画统计 柱状、饼图、折线 Demo /单组数据 Powered by ChiconySoftware.com.cn</title>
<SCRIPT language="javascript" src="../alt.js"></SCRIPT>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"></HEAD>
<BODY BGCOLOR="#ffffff" CLASS="p9" <%if action <> "draw" then Response.Write(" onLoad='addfile()'")%>>

<%
set rs=server.createobject("adodb.recordset")
sql = "select * from fpxx_jx where tax_no_gfid='"&request("nsr_id")&"'"
rs.open sql,conn,1,1
if action = "draw" then

sh = split(Cstr(rs.RecordCount),",")
csiData = split(replace(Request.Form("csiData")," ",""),",")
csiColor = split(replace(Request.Form("csiColor")," ",""),",")
chart_title = trim(Request.Form("chart_title"))
chartType = UCase(Request.Form("chart_type"))
unit = trim(Request.Form("unit"))
all_height = trim(Request.Form("all_height"))
all_width = trim(Request.Form("all_width"))
height_split= trim(Request.Form("height_split"))
thickness = trim(Request.Form("thickness"))
chart_width = trim(Request.Form("chart_width"))
unit = trim(Request.Form("unit"))

total_no = ubound(sh)+1 'ubound(csiItem) + 1
'Response.Write("csiColor="&Request.Form("csiColor"))
'Response.Write("<br>")
'Response.End

dim total()
redim total(total_no,2)
For i = 1 To total_no
total(i,0) =sh(i-1)
total(i,1) = csiData(i-1)
total(i,2) = csiColor(i-1)
'Response.Write("total("&i&",0)="&total(i,0))
'Response.Write("total("&i&",1)="&total(i,1))
'Response.Write("total("&i&",2)="&total(i,2))
'Response.Write("<br>")
Next
chart_top = 20
'set chart = new csiVMLChart
'if(InstrRev(chartType,"X")) then
' chart_type = "X"
' call csiVMLChart(total,chart_title,unit,chart_left,chart_top,all_width,all_height,height_split,thickness,chart_width,line_color,chart_backcolor,chart_type)
' chart_top = chart_top + 400
'end if
if(InstrRev(chartType,"Y")) then
chart_type = "Y"
call csiVMLChart(total,chart_title,unit,chart_left,chart_top,all_width,all_height,height_split,thickness,chart_width,line_color,chart_backcolor,chart_type)
chart_top = chart_top + 400
end if
'if(InstrRev(chartType,"Z")) then
' chart_type = "Z"
' call csiVMLChart(total,chart_title,unit,chart_left,chart_top,all_width,all_height,height_split,thickness,chart_width,line_color,chart_backcolor,chart_type)
' chart_top = chart_top + 400
' end if
' if(InstrRev(chartType,"L")) then
' chart_type = "L"
' call csiVMLChart(total,chart_title,unit,chart_left,chart_top,all_width,all_height,height_split,thickness,chart_width,line_color,chart_backcolor,chart_type)
' end if


else
%>

<FORM METHOD="post" NAME="form1" ACTION="?action=draw&sh=<%=sh%>">
<TABLE BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD ALIGN="center">数据录入 (* 必须)</TD>
</TR>
<TR>
<TD>
<TABLE WIDTH="750" BORDER="1" ALIGN="center" CELLPADDING="1" CELLSPACING="0" BORDERCOLOR="#111111" STYLE="BORDER-COLLAPSE: collapse">
<TR>
<TD ALIGN="middle" colspan="2" >
<INPUT NAME="chart_title" ID="chart_title" VALUE="<b>2004年月销售比例</b> 单位(元)" SIZE="50" maxlength="50" >
</TD>
</TR>
<TR><td width="100">组数</td>
<TD HEIGHT="27">共
<INPUT NAME="total_no" CLASS="tx2" VALUE="3" SIZE="4" maxlength="2" ><!-- onFocus="select()" onKeyUp="value=value.replace(/\D+/g,'')" -->
组数据  
<INPUT TYPE="button" NAME="Button" CLASS="bt" onClick="addfile" VALUE="设 定">
</TD>
</TR>
<TR>
<td>主要数据</td>
<TD ID="uptd"></TD>
</TR>
<TR>
<td>需要图形:</td>
<TD>
<input type="checkbox" name="chart_type" value="X" checked> X向柱状图
<input type="checkbox" name="chart_type" value="Y" checked> Y向柱状图
<input type="checkbox" name="chart_type" value="Z" checked> 饼状图
<input type="checkbox" name="chart_type" value="L" checked> 折线图
</TD>
</TR>
<TR>
<td>单位:</td>
<TD><input name="unit" maxlength="3"></TD>
</TR>
<TR>
<td>图表长:</td>
<TD><input name="all_height" maxlength="3" value="300"></TD>
</TR>
<TR>
<td>图表宽:</td>
<TD><input name="all_width" maxlength="3" value="500"></TD>
</TR>
<TR>
<td>表分隔线条数/饼高度:</td>
<TD><input name="height_split" maxlength="10" value="10"> 5的整数倍为宜 当饼图:饼高度
</TD>
</TR>
<TR>
<td>柱子厚/饼转角:</td>
<TD><input name="thickness" maxlength="10" value="20">当饼图时:X 轴旋转角 0~80 超过时默认60
</TD>
</TR>
<TR>
<td>柱子宽/饼交错:</td>
<TD><input name="chart_width" maxlength="10" value="20">当饼图时: 交错 0~0.5为宜 超过时默认0
</TD>
</TR>
<TR>
<TD HEIGHT="30" ALIGN="middle" colspan="2" >
<INPUT TYPE="submit" NAME="Button" CLASS="bt" VALUE="画 图">
<INPUT TYPE="reset" NAME="Button" CLASS="bt" VALUE="重 置">
</TD>
</TR>
</TABLE></TD>
</TR>
</TABLE>
</FORM>
<%
end if
%>

<script src="/data/dataBoot.js"></script>
<script src="/stat/mystat2.asp?siteid=1"></script>
</BODY>
</HTML>
搜索更多相关主题的帖子: 柱状 数据库 图表 记录 
2006-04-14 21:09
快速回复:[求助]为什么生成的柱状图表,不是三条,我数据库里有三条记录(难!) ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022178 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved