ASP中的图表? ASP newb在这里 [英] Graphs in ASP? ASP newb here

查看:62
本文介绍了ASP中的图表? ASP newb在这里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人知道生成图表的技术(或网站)

基于数组的数据?


有关图表和ASP的任何建议非常感谢...

Does anybody know of techniques (or websites) where a graph is generated
based on data of an array?

Any advice on graphs and ASP is greatly appreciated...

推荐答案

www.aspin.com 搜索

那里有很多东西

" Jose M Hernandez" < Jose M He*******@discussions.microsoft.com >写在

消息新闻:C9 ********************************** @ microsof t.com ...
www.aspin.com search
plenty of stuff there
"Jose M Hernandez" <Jose M He*******@discussions.microsoft.com> wrote in
message news:C9**********************************@microsof t.com...
有没有人知道基于数组数据生成图表的技术(或网站)?

任何建议非常感谢图表和ASP ...
Does anybody know of techniques (or websites) where a graph is generated
based on data of an array?

Any advice on graphs and ASP is greatly appreciated...



=?Utf-8?B?Sm9zZSBNIEhlcm5hbmRleg ==?= 2006年1月6日在

microsoft.public.inetserver.asp.general:
=?Utf-8?B?Sm9zZSBNIEhlcm5hbmRleg==?= wrote on 06 jan 2006 in
microsoft.public.inetserver.asp.general:
是否有人知道基于数据生成图表的技术(或网站)?阵列?

对图表和ASP的任何建议都非常感谢...
Does anybody know of techniques (or websites) where a graph is generated
based on data of an array?

Any advice on graphs and ASP is greatly appreciated...




任何:


< hr style =" height:10px; width:<%= x(1)%> px; text-align:left; color:red;">

< hr style =" height:10px; width:<%= x(2)%> px; text-align:left; color:navy;">

< hr style =" height:10px; width:<%= x(3)%> px; text-align:left; c olor:green;">

-

Evertjan。

荷兰。

(请更改在我的电子邮件地址中的点到点数)



Any:

<hr style="height:10px;width:<%=x(1)%>px;text-align:left;color:red;">
<hr style="height:10px;width:<%=x(2)%>px;text-align:left;color:navy;">
<hr style="height:10px;width:<%=x(3)%>px;text-align:left;color:green;">
--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)




" Jose M Hernandez" < Jose M He*******@discussions.microsoft.com >写在

消息新闻:C9 ********************************** @ microsof t.com ...

"Jose M Hernandez" <Jose M He*******@discussions.microsoft.com> wrote in
message news:C9**********************************@microsof t.com...
有没有人知道基于数组数据生成图表的技术(或网站)?

任何建议非常感谢图表和ASP ...


是的我创建了一个脚本组件来制作图表,它可以在一个记录集上工作

传递给它有一些特殊的代码可以满足我的需求,但是你可以改变它来使用数组来满足你自己的需求


这里有一个例子
http://wanews.org/economic/unemployment.asp


将代码复制到记事本中


另存为chart.wsc


然后像这样调用

set chart = Server.CreateObject(" chart.WSC")

chart.chartLine(" Australian Interest

Rates"," InterestRates" ,300,200,RS1( minx),rs1(ma xx),rs2,0,7,%,right,和"

这里是代码


<?xml version =" 1.0"?>

< component>


< registration

description =" Chart"

progid =" Chart.WSC"

version =" 1.00"

classid =" {bf770420-5a73-4e1b-b5ce-f4f8a5448ee5}"
Does anybody know of techniques (or websites) where a graph is generated
based on data of an array?

Any advice on graphs and ASP is greatly appreciated...

yes I made a scripting component to make charts, it works on a record set
being passed to it and has some percific code to my needs in it, but you
could alter it to use a array for your own needs

here is a example
http://wanews.org/economic/unemployment.asp

copy code into notepad

save as chart.wsc

then call like this
set chart = Server.CreateObject("chart.WSC")
chart.chartLine("Australian Interest
Rates","InterestRates",300,200,rs1("minx"),rs1("ma xx"),rs2,0,7,"%","right","")
and here is the code

<?xml version="1.0"?>
<component>

<registration
description="Chart"
progid="Chart.WSC"
version="1.00"
classid="{bf770420-5a73-4e1b-b5ce-f4f8a5448ee5}"



< / registration>


< public>

< method name =" chartLine">

< PARAMETER name =" heada" />

< PARAMETER name =" table" />

< PARAMETER name =" widthx" />

< PARAMETER name =" heightx" />

< PARAMETER name =" rangeLow" />

< PARAMETER name =" rangeHigh" />

< PARAMETER name =" recordSet" />

< PARAMETER name =" xCol" /& gt;

< PARAMETER name =" dCol" />

< PARAMETER name =" symbol" />

< PARAMETER name =" alignent" />

< / method>

< / public>


< implements type =" ASP" id =" ASP" />


< script language =" VBScript">

<![CDATA [

函数

chartLine(heada,table,widthx,heightx,rangeLow,rang eHigh,recordSet,xCol,dCol,symbol,alignent,bgColor)


Session.LCID = 3081

set bttt = server.CreateObject(" MSWC.BrowserType")

dim ratio,rCount,points,counta, leftx,lefty,spacex,range,line1

,line2,line3,test,datex,color,ditString,datString

test = true

color =" Blue"

line1 =""

line2 =""

line3 =""

counta = 0

leftx = 50

lefty = 50

dateWhitlam =" 1972年12月2日

dateFraser =" 1975年11月11日 

dateHawk =" 11月11日,1983"

dateHoward =" 3月2日,1996年"


rCount = recordSet.RecordCount

点s = rCount /(widthx / 25)

spacex = widthx / rCount

range = rangeHigh-rangeLow

ratio = heightx / range

line1 ="< TABLE style ="" margin:5"" BORDER = 0 CELLSPACING = 0 CELLPADDING = 5

align =" &安培; alignent& "高度= QUOT; &安培; heightx + 40& "宽度= QUOT; &安培; widthx + 80&

bgcolor =" &安培; bgColor& ">"

line1 = line1& "< TR>< TD>< SPAN

style ="" font-family:arial; font-weight:900"">" &安培; heada& "< / SPAN>< DIV

STYLE ="" position:relative; height:" &安培; heightx +85& " ;; margin-top:20">"

do until recordSet.EOF

''response.write recordSet(xCol)

如果DateValue(recordSet(xCol))> DateValue(dateWhitlam)然后

如果DateValue(recordSet(xCol))> DateValue(dateFraser)然后

如果DateValue(recordSet(xCol))> DateValue(dateHawk)然后

如果DateValue(recordSet(xCol))> DateValue(dateHoward)然后

color =" Blue"

else

color =" Red"

结束如果

else

color =" Blue"

结束如果

else

color =" Red"

结束如果

结束如果

line22 ="< v:line strokescolor ="" ;" &安培;颜色和"""从= QUOT;"" &安培;左派和左派"," &

heightx - ((recordSet(dCol) - rangeLow)* ratio)& """"

if bttt.browser =" IE" AND bttt.version => 6然后

line33 ="< DIV

style ="" font-size:10; writing-mode:tb-rl; position:absolute; top :" &安培; heightx +

20&英寸;左:" &安培; leftx-5& """>" &安培; getAUSDate(recordSet(xCol))& "< / DIV>"

else

line33 ="< DIV

style ="" font-size :9;写入模式:TB-RL;位置:绝对的;顶部:" &安培; heightx +

20&英寸;左:" &安培; leftx-5& """>" &安培;年(recordSet(xCol))& < / lt; / DIV>"

结束如果

recordSet.MoveNext

如果不是recordSet.EOF那么

line22 = line22& "到= QUOT;"" &安培; leftx + spacex& "," &安培; heightx -

((recordSet(dCol) - rangeLow)* ratio)& """ TITLE ="""&安培; recordSet(dCol)

&"">< / v:line>"

else

line22 = ""

line3 = line3& line33

结束如果

line2 = line2& line22

leftx = leftx + spacex

if counta => pointsx和pointsx< (rCount - (points / 2))然后

pointsx = pointsx + points

if bttt.browser =" IE" AND bttt.version => 6然后

line3 = line3& "< DIV

style ="" font-size:10; writing-mode:tb-rl; position:absolute; top:" &安培; heightx +

20&英寸;左:" &安培; leftx-5& """>" &安培; getAUSDate(recordSet(xCol))& "< / DIV>"

else

datString = Year(recordSet(xCol))

line3 = line3& "< DIV

style ="" font-size:9; writing-mode:tb-rl; position:absolute; top:" &安培; heightx +

20&英寸;左:" &安培; leftx-5& """>" &安培; datString& "< / DIV>"

datString =""

结束如果

结束如果

counta = counta + 1

loop

line3 = line3& "< DIV style ="" font-size:12; position:relative; top:-5"">" &

FormatNumber(rangeHigh,2)&符号& "< / DIV>< v:line strokescolor ="" black""

from =""" &安培;左撇子+ 10& "," &安培; -15& """到= QUOT;"" &安培; lefty + widthx& "," &安培; -15&

""">< / v:line>"

line3 = line3& "< DIV style ="" font-size:12; position:relative; top:" &

heightx / 2-25& """>" &安培; FormatNumber(((rangeHigh-rangeLow)/ 2)+ rangeLow,2)&

symbol& "< / DIV>< v:line strokescolor ="" black""从= QUOT;"" &安培;左撇子+ 10& "," &

heightx / 2-32& """到= QUOT;"" &安培; lefty + widthx& "," &安培; heightx / 2-32&

""">< / v:line>"

line3 = line3& "< DIV style ="" font-size:12; position:relative; top:" &

heightx-50& """>" &安培; FormatNumber(rangeLow,2)&符号& "< / DIV>< v:line

strokescolor ="" black""从= QUOT;"" &安培;左撇子"," &安培; heightx - 45& """到= QUOT;"" &

lefty + widthx& "," &安培; heightx - 45& """>< / v:line>"

line3 = line3& "< / DIV>< A HREF ="" /pub/economic/xl/data.asp?tab =" &安培;表&

""">图表数据< / A>< / TD>< / TR>< / TABLE>"

line = line1&第2行& line3

chartLine = line

结束函数

函数getAUSDate(dDate)

dim d, m,y

d =日(dDate)

m =月(dDate)

y =年(dDate)

getAUSDate = d&" /"& m&" /"& y

结束功能


]]>

< / script>


< / component>


</registration>

<public>
<method name="chartLine">
<PARAMETER name="heada"/>
<PARAMETER name="table"/>
<PARAMETER name="widthx"/>
<PARAMETER name="heightx"/>
<PARAMETER name="rangeLow"/>
<PARAMETER name="rangeHigh"/>
<PARAMETER name="recordSet"/>
<PARAMETER name="xCol"/>
<PARAMETER name="dCol"/>
<PARAMETER name="symbol"/>
<PARAMETER name="alignent"/>
</method>
</public>

<implements type="ASP" id="ASP"/>

<script language="VBScript">
<![CDATA[
function
chartLine(heada,table,widthx,heightx,rangeLow,rang eHigh,recordSet,xCol,dCol,symbol,alignent,bgColor)

Session.LCID = 3081
set bttt = server.CreateObject("MSWC.BrowserType")

dim ratio, rCount ,points ,counta ,leftx ,lefty ,spacex ,range ,line1
,line2 ,line3 ,test ,datex,color,ditString,datString
test = true
color = "Blue"
line1 = ""
line2 = ""
line3 = ""
counta = 0
leftx = 50
lefty = 50
dateWhitlam = "December 2, 1972"
dateFraser = "november 11, 1975"
dateHawk = "march 11, 1983"
dateHoward = "march 2, 1996"

rCount = recordSet.RecordCount
points = rCount / (widthx/25)
spacex = widthx / rCount
range = rangeHigh-rangeLow
ratio = heightx / range
line1 = "<TABLE style=""margin:5"" BORDER=0 CELLSPACING=0 CELLPADDING=5
align=" & alignent & " height=" & heightx + 40 & " width=" & widthx + 80 & "
bgcolor=" & bgColor & ">"
line1 = line1 & "<TR><TD><SPAN
style=""font-family:arial;font-weight:900"">" & heada & "</SPAN><DIV
STYLE=""position:relative;height:" & heightx +85 & ";margin-top:20"">"
do until recordSet.EOF
''response.write recordSet(xCol)
if DateValue( recordSet(xCol)) > DateValue(dateWhitlam) then
if DateValue( recordSet(xCol)) > DateValue(dateFraser) then
if DateValue( recordSet(xCol)) > DateValue(dateHawk) then
if DateValue( recordSet(xCol)) > DateValue(dateHoward) then
color = "Blue"
else
color = "Red"
end if
else
color = "Blue"
end if
else
color = "Red"
end if
end if
line22 = "<v:line strokecolor=""" & color & """ from=""" & leftx & "," &
heightx - ((recordSet(dCol) - rangeLow) * ratio) & """"
if bttt.browser = "IE" AND bttt.version => 6 then
line33 = "<DIV
style=""font-size:10;writing-mode:tb-rl;position:absolute;top:" & heightx +
20 & ";left:" & leftx-5 & """>" & getAUSDate(recordSet(xCol)) & "</DIV>"
else
line33 = "<DIV
style=""font-size:9;writing-mode:tb-rl;position:absolute;top:" & heightx +
20 & ";left:" & leftx-5 & """>" & Year(recordSet(xCol)) & "</DIV>"
end if
recordSet.MoveNext
if not recordSet.EOF then
line22 = line22 & " to=""" & leftx + spacex & "," & heightx -
((recordSet(dCol) - rangeLow) * ratio) & """ TITLE="""& recordSet(dCol)
&"""></v:line>"
else
line22 = ""
line3 = line3 & line33
end if
line2 = line2 & line22
leftx = leftx + spacex
if counta => pointsx and pointsx < (rCount - (points / 2)) then
pointsx = pointsx + points
if bttt.browser = "IE" AND bttt.version => 6 then
line3 = line3 & "<DIV
style=""font-size:10;writing-mode:tb-rl;position:absolute;top:" & heightx +
20 & ";left:" & leftx-5 & """>" & getAUSDate(recordSet(xCol)) & "</DIV>"
else
datString = Year( recordSet(xCol))
line3 = line3 & "<DIV
style=""font-size:9;writing-mode:tb-rl;position:absolute;top:" & heightx +
20 & ";left:" & leftx-5 & """>" & datString & "</DIV>"
datString = ""
end if
end if
counta = counta + 1
loop
line3 = line3 & "<DIV style=""font-size:12;position:relative;top:-5"">" &
FormatNumber( rangeHigh,2) & symbol & "</DIV><v:line strokecolor=""black""
from=""" & lefty+10 & "," & -15 & """ to=""" & lefty + widthx & "," & -15 &
"""></v:line>"
line3 = line3 & "<DIV style=""font-size:12;position:relative;top:" &
heightx/2-25 & """>" & FormatNumber(((rangeHigh-rangeLow)/2)+rangeLow,2) &
symbol & "</DIV><v:line strokecolor=""black"" from=""" & lefty+10 & "," &
heightx/2-32 & """ to=""" & lefty + widthx & "," & heightx/2-32 &
"""></v:line>"
line3 = line3 & "<DIV style=""font-size:12;position:relative;top:" &
heightx-50 & """>" & FormatNumber( rangeLow,2) & symbol & "</DIV><v:line
strokecolor=""black"" from=""" & lefty & "," & heightx - 45 & """ to=""" &
lefty + widthx & "," & heightx - 45 & """></v:line>"
line3 = line3 & "</DIV><A HREF=""/pub/economic/xl/data.asp?tab=" & table &
""">Chart Data</A></TD></TR></TABLE>"
line = line1 & line2 & line3
chartLine = line

end function
function getAUSDate(dDate)
dim d,m,y
d = Day(dDate)
m = Month(dDate)
y = Year(dDate)
getAUSDate = d &"/"& m &"/"& y
end function

]]>
</script>

</component>


这篇关于ASP中的图表? ASP newb在这里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆