实时曲线

lovefootball 2004-09-28 03:04:02
我想用C#做一个随着时间变化而变化的曲线,是BS结构的,曲线数据变化而页面不出现刷新的样子,就像股票的那个实时曲线一样
数据的来源是Oracle或者是XML都可以
怎么实现啊?~~~~~~~~~~~
...全文
312 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
townee 2004-10-10
  • 打赏
  • 举报
回复
以下是dircrt在ie中画图的倒子
private void Button1_Click(object sender, System.EventArgs e)
{
//显示坐标系
StreamReader fs=new StreamReader(Server.MapPath(""+"hzbx.js"));
tmpsql=fs.ReadToEnd();
fs.Close();
this.RegisterStartupScript("hzbx","<script>"+tmpsql+"</script>");

zt();
//this.RegisterStartupScript("tx","<script>"+tmpsql+"</script>");

fs=new StreamReader(Server.MapPath(""+"xstx.js"));
tmpsql=fs.ReadToEnd();
fs.Close();
this.RegisterStartupScript("xstx","<script>"+tmpsql+"</script>");
//显示坐标系

}
private void zt() //坐图
{
zlsr();
xbc=fhxbc();
ybc=fhybc();
tmpsql="sf.linewidth(2);"; //线宽";"

for (int i=0;i<txsj.yysr.Count;i++)
{
if (i>0)
{

tmpsql+="sf.linecolor(ml.colorrgb(0,1,0));"; //绿色线划门诊收入
tmpsql+="sf.line('"+bhx((i-1)*xbc)+"','"+bhy((txsj.yysr[i-1].门诊收入-min)*ybc)+"','"+bhx(i*xbc)+"','"+bhy((txsj.yysr[i].门诊收入-min)*ybc)+"');";
tmpsql+="sf.linecolor(ml.colorrgb(0,0,1));"; //兰色线划住院收入
tmpsql+="sf.line('"+bhx((i-1)*xbc)+"','"+bhy((txsj.yysr[i-1].住院收入-min)*ybc)+"','"+bhx(i*xbc)+"','"+bhy((txsj.yysr[i].住院收入-min)*ybc)+"');";
tmpsql+="sf.linecolor(ml.colorrgb(1,0,0));"; //红色线划总收入
tmpsql+="sf.line('"+bhx((i-1)*xbc)+"','"+bhy((txsj.yysr[i-1].总收入-min)*ybc)+"','"+bhx(i*xbc)+"','"+bhy((txsj.yysr[i].总收入-min)*ybc)+"');";
//写x轴坐标
if (txsj.yysr.Count<=6)
tmpsql+="sf.text('"+txsj.yysr[i].日期.ToShortDateString()+"','"+bhx(i*xbc-100)+"','"+bhy(5)+"');";
else
{
int bc=txsj.yysr.Count/6;
if (i==bc)
tmpsql+="sf.text('"+txsj.yysr[i].日期.ToShortDateString()+"','"+bhx(100)+"','"+bhy(5)+"');";
if (i==2*bc)
tmpsql+="sf.text('"+txsj.yysr[i].日期.ToShortDateString()+"','"+bhx(200)+"','"+bhy(5)+"');";
if (i==3*bc)
tmpsql+="sf.text('"+txsj.yysr[i].日期.ToShortDateString()+"','"+bhx(300)+"','"+bhy(5)+"');";
if (i==4*bc)
tmpsql+="sf.text('"+txsj.yysr[i].日期.ToShortDateString()+"','"+bhx(400)+"','"+bhy(5)+"');";
if (i==5*bc)
tmpsql+="sf.text('"+txsj.yysr[i].日期.ToShortDateString()+"','"+bhx(500)+"','"+bhy(5)+"');";
if (i==6*bc)
tmpsql+="sf.text('"+txsj.yysr[i].日期.ToShortDateString()+"','"+bhx(600)+"','"+bhy(5)+"');";
}
}
}
//写y轴坐标
string y1;
string y2;
string y3;
y1=Convert.ToString(Math.Round(((max-min)/3+min),0));
y2=Convert.ToString(Math.Round((2*(max-min)/3+min),0)) ;
y3=Convert.ToString(Math.Round(max,0)) ;
tmpsql+="sf.text('"+y1+"','"+bhx(0)+"','"+bhy(100)+"');";
tmpsql+="sf.text('"+y2+"','"+bhx(0)+"','"+bhy(200)+"');";
tmpsql+="sf.text('"+y3+"','"+bhx(0)+"','"+bhy(290)+"');";
this.RegisterStartupScript("zt","<script>"+tmpsql+"</script>" );
}
lovefootball 2004-10-09
  • 打赏
  • 举报
回复
我先研究研究
哪位能给点XmlHttp的资料啊
raulredondo 2004-09-28
  • 打赏
  • 举报
回复
在picturebox上面画画啊,可以用DrawCurve这个函数,就是画曲线的
forever10 2004-09-28
  • 打赏
  • 举报
回复
www.codeproject.com zedgraph
Lostinet 2004-09-28
  • 打赏
  • 举报
回复
这个一般用VML+XMLHTTP来做吧..
不过VML也挺麻烦的,可以参考画线的语句,主要是修改其中的坐标就可以了,
客户端发送请求,
在服务器循环数据,每段数据画一条线,生成HTML后返回.
happyjun2000 2004-09-28
  • 打赏
  • 举报
回复
或者用组态软件来实现
happyjun2000 2004-09-28
  • 打赏
  • 举报
回复
在页面中添加一个iframe来存放你的曲线控件,然后用xmlhttp来后台刷新曲线数据
var oXMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );

var sURL = "delEquip.aspx?id=" + id + "&isFolder="+ ftype;
//alert (sURL)
oXMLHTTP.open( "POST", sURL, false );

oXMLHTTP.send();
Tomgus 2004-09-28
  • 打赏
  • 举报
回复
可以用 owc控件
lovefootball 2004-09-28
  • 打赏
  • 举报
回复
自己顶

111,094

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧