|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
楼上说交互性不好,太牵强了吧。在微软提供的一套框架中,利用asp做网站,开发效率高,使用人数少,减少不必要的开销。交互性是互动方式,是有开发人员决定的。chart<SCRIPTLANGUAGE="VBScript"RUNAT="SERVER">
functionmakechart(title,numarray,labelarray,color,bgcolor,bordersize,maxheight,maxwidth,addvalues)
Functionmakechartversion3
JasonBorovoy
title:ChartTitle
numarray:Anarrayofvaluesforthechart
labelarray:Anarrayoflabelscorespondingtothevaluesmustmepresent
colorIfnullusesdifferentcolorsforbarsifnotnullallbarscoloryouspecify
bgcolorBackgroundcolor.
bordersize:bordersizeor0fornoborder.
maxheight:maximumheightforchartnotincludinglabels
maxwidth:widthofeachcolumn
addvalues:trueorfalsedependingifyouwanttheactualvaluesshownonthechart
whenyoucallthefunctionuse:response.writemakechart(parameters)
actuallyreturnstringwouldbeabettername
dimtablestring
maxvalueismaximumtablevalue
dimmax
maxlengthmaximumlengthoflabels
dimmaxlength
dimtempnumarray
dimtemplabelarray
dimheightarray
Dimcolorarray
valuetomultipliechartvaluesbytogetrelitivesize
Dimmultiplier
ifdatavalid
ifmaxheight>0andmaxwidth>0andubound(labelarray)=ubound(numarray)then
colorarray:colorofeachbarsifmorebarsthencolorsloopthrough
ifyoudontlikemychoiceschangethem,addthem,deletethem.
colorarray=array("red","blue","yellow","navy","orange","purple","green")
templabelarray=labelarray
tempnumarray=numarray
heightarray=array()
max=0
maxlength=0
tablestring="<TABLEbgcolor="&bgcolor&"border="&bordersize&">"&_
"<tr><td><TABLEborder=0cellspacing=1cellpadding=0>"&vbCrLf
getmaximumvalue
foreachstuffintempnumarray
ifstuff>maxthenmax=stuffendif
next
calculatemultiplier
multiplier=maxheight/max
populatearray
forcounter=0toubound(tempnumarray)
iftempnumarray(counter)=maxthen
redimpreserveheightarray(counter)
heightarray(counter)=maxheight
else
redimpreserveheightarray(counter)
heightarray(counter)=tempnumarray(counter)*multiplier
endif
next
settitle
tablestring=tablestring&"<TR><THcolspan="&ubound(tempnumarray)+1&">"&_
"<FONTFACE=Verdana,Arial,HelveticaSIZE=1><U>"&title&"</TH></TR>"&_
vbCrLf&"<TR>"&vbCrLf
loopthroughvalues
forcounter=0toubound(tempnumarray)
tablestring=tablestring&vbTab&"<TDvalign=bottomalign=center>"&_
"<FONTFACE=Verdana,Arial,HelveticaSIZE=1>"&_
"<tableborder=0cellpadding=0width="&maxwidth&"><tr>"&_
"<tr><tdvalign=bottombgcolor="
ifnotisNUll(color)then
ifcolorpresentusethatcolorforbars
tablestring=tablestring&color
else
ifnotloopthroughcolorarray
tablestring=tablestring&colorarray(countermod(ubound(colorarray)+1))
endif
tablestring=tablestring&"height="&_
round(heightarray(counter),2)&"><imgsrc=http://www.163design.net/a/q/chart.gifwidth=1height=1>"&_
"</td></tr></table>"
ifaddvaluesthen
printactualvalues
tablestring=tablestring&"<BR>"&tempnumarray(coun</p>asp可以使用微软的activeX使得网页功能无比强大,不过安全性也较差,而且是基于的windows服务器,所以性能稳定性也一般 |
|