正在做一个脉搏波显示程序,可是timer控制的时间轴的起点不变,波形一直在压缩,请教各位前辈怎样让时间变,波形随着时间向左移动呢?还有出现一个波形,界面上就会出现一句”my curve“,如何让波形一直动,但是只出现一句”my curve“呢?在此,先谢谢各位了
private void timer1_Tick(object sender, EventArgs e)
{
int j = 41;
zedGraphControl1.GraphPane.XAxis.Scale.MaxAuto = true;
int[] arrayInt; arrayInt = new int[] { 0, 33, 73, 119, 159, 180, 179, 166, 149, 130, 110, 94, 84, 81, 82, 84, 83, 80, 75, 70, 65, 59, 53, 48, 42, 36, 31, 26, 22, 18, 15, 12, 10, 8, 7, 6, 6, 6, 6, 4, 2, 0 };
double x = (double)new XDate(DateTime.Now);
double y = arrayInt[i];
i++;
DateTime dt = DateTime.Now;
if (i == j )
{ i = 0;
j = 0;
myCurve = zedGraphControl1.GraphPane.AddCurve("My Curve", list, Color.DarkBlue, SymbolType.None);
this.zedGraphControl1.AxisChange();
this.zedGraphControl1.Refresh();
} } private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
timer1.Start();
}
timerC# zedgraph
private void timer1_Tick(object sender, EventArgs e)
{
int j = 41;
zedGraphControl1.GraphPane.XAxis.Scale.MaxAuto = true;
int[] arrayInt; arrayInt = new int[] { 0, 33, 73, 119, 159, 180, 179, 166, 149, 130, 110, 94, 84, 81, 82, 84, 83, 80, 75, 70, 65, 59, 53, 48, 42, 36, 31, 26, 22, 18, 15, 12, 10, 8, 7, 6, 6, 6, 6, 4, 2, 0 };
double x = (double)new XDate(DateTime.Now);
double y = arrayInt[i];
i++;
DateTime dt = DateTime.Now;
if (i == j )
{ i = 0;
j = 0;
myCurve = zedGraphControl1.GraphPane.AddCurve("My Curve", list, Color.DarkBlue, SymbolType.None);
this.zedGraphControl1.AxisChange();
this.zedGraphControl1.Refresh();
} } private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
timer1.Start();
}
timerC# zedgraph
解决方案 »
- 求一个正则表达式
- C# 基于UDP实现聊天,获取发送信息方IP的问题
- C#技巧集,C#葵花宝典可以下载了
- 工作流(workflow)中的一些名词解释,大家帮忙看看
- ExecuteNonQuery 是应该叫做"执行无结果集的查询",还是应该叫做"执行不是查询语句"
- sql参数为什么传不过来!
- 请问如何尽快学会C#?
- 有没有发邮件的类在winform中?
- C#中的动态实例化
- 什么是C#编译器,怎么使用csc xxx.cs 进行调试?
- public int Add<T>(T entity) where T : EntityObject 请问这个语法是什么意思?
- 求大牛帮忙看看这两个验证码 有什么好办法识别吗
(1)数据源。波形往左移,事实上是数据在规律的变化。但你现在的数据原不是如此。
(2)...AddCurve("My Curve",...。此句不断新增曲线,自然会有问题。具体可以参见博文:http://www.cnblogs.com/dahuzizyd/articles/621494.html