ASP+VML自动生成实时行情走势图
来源:互联网 发布:java compareto 编辑:程序博客网 时间:2024/04/27 15:33
该表包括如下几个字段
price(价格) shang_id(对应的商品ID) p_time(该价格的时间);具体数据请自行输入;现根据该价格信息生成某商品在某年某月的价格行情走势图(曲线图,非柱状图)。
<!--tu.asp开始-->
<% if request("tyr")="" or request("tmon")="" or request("shid")="" or not isnumeric(request("tyr")) or not isnumeric(request("tmon")) or not isnumeric(request("shid")) then
response.write "参数错误,请确认您输入了正确的网址。"
response.end
end if
dim conn,constr,db
db="test.mdb"
set conn=Server.CreateObject("ADODB.Connection")
constr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &server.MapPath(db)
conn.open constr
if err then
err.clear
conn.close
set conn=nothing
response.write "暂时无法访问数据库,请稍候再试。"
response.end
end if
'以上为连接数据库部分
set rstemp=conn.execute("select top 1 price,p_time from [pric] where shang_id="&request("shid")&" and year(p_time)="&request("tyr")&" and month(p_time)="&request("tmon")&" order by price desc")
ttop=rstemp(0)
set rs=server.createobject("adodb.recordset")
sql="select price,p_time,shang_id from [pric] where shang_id="&request("shid")&" and year(p_time)="&request("tyr")&" and month(p_time)="&request("tmon")&""
rs.open sql,conn,1,1
i=0
do while not rs.eof and i<=31
pric=rs("price")
i=i+1
k=200+80*i
j=cint(2200-(pric/ttop)*2000)
tzb=tzb&k&","&j&" "
rs.movenext
loop %>
<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title>行情图</title>
<STYLE>
v/:* { Behavior: url(#default#VML) }
</STYLE>
</head>
<body topmargin="0" leftmargin="0">
<v:group ID="group1" style="WIDTH:240pt;HEIGHT:300pt" coordsize="2400,3000">
<v:line from="200,100" to="200,2100" style="Z-INDEX:8;POSITION:absolute" strokeweight="1pt">
<v:stroke StartArrow="classic"/>
</v:line>
<v:line from="200,2100" to="2680,2100" style="Z-INDEX:8;POSITION:absolute" strokeweight="1pt">
<v:stroke EndArrow="classic"/>
</v:line>
<v:rect style="WIDTH:3000px;HEIGHT:2400px" coordsize="21600,21600" fillcolor="white" strokecolor="black" />
<v:PolyLine filled="false" Points="<%=tzb%>" style="position:relative"/>
<v:stroke StartArrow="Oval" EndArrow="Classic" dashstyle="Dot" />
</v:PolyLine>
</group>
</body>
</html>
<!--tu.asp结束-->
该页网址后应跟上相应的参数tyr;tmon;shid分边表示所查询的年、月以及商品ID;例如:
test.asp?tyr=2004&tmon=10&shid=1
表示所查询的是ID为1的商品于2004年10月的价格走势图。
最终的图形显示效果如下:
- ASP+VML自动生成实时行情走势图
- 用ASP及VML实现股票走势图
- 比特币行情走势图
- Android行情走势图
- VML/ASP生成柱状图、曲线图、饼状图
- 生成股票走势图jfreechart
- 纯ASP结合VML生成完美图-柱图
- 纯ASP结合VML生成完美图-饼图
- 纯ASP结合VML生成完美图-折线图
- 关于ASP用vml动态生成直方图的完整示例
- 纯ASP结合VML生成完美图-折线图
- 纯ASP结合VML生成完美图-折线图
- 脚本动态生成VML
- asp+VML统计图
- asp+vml画图收藏
- asp vml 对比柱形图
- Asp.net mvc 实时生成缩率图到硬盘
- Asp.net mvc实时生成缩率图到硬盘
- 存储过程介绍及asp存储过程的使用
- 如何写注释
- 对客户端的ip限制函数
- time例子
- C#开发小技巧--对Text控件增量赋值的代码优化
- ASP+VML自动生成实时行情走势图
- JS动态提示定时返回指定页面,相当于倒计时
- 在apache中安装mod_ruby和eruby
- 用C#创建可拖动窗体
- 如何取得IP/用户名等信息
- Eclipse 3.0资料收集
- CSDN Blog 界面个性化指南
- 关于朴 [道德经]
- 业务流程管理:过去,现在,未来