Hi,
I am writing a realtime data processig application with TeeChart series graphs. In my application, the typical horizontal axis range is 10 sec, while the data for the series are supplied from the data acquisition system every second. That necessitates the piecewise drawing of the series.
One series for 10sec time period could be completed by succession of 10 times of 1sec data drawing.
Alas! I do not know how to acomplish this kind of successive drawing.
What I tried to do is like this:
Code: Select all
static int callCount=0;
void handlerOf_Event(object sender, System.EventArgs e)
{
int N=10;
double[] x=new double[N];
double[] y=new double[N];
for(int i=0;i<N;i++)
{
x[i]=(double)( i + N*callCount );
y[i]=Math.Sin(x[i]*0.1)*10;
}
this.tChart1.Series[0].Add(x,y);
callCount++;
if(callCount>=10)
{
callCount=0;
this.tChart1.Series[0].Delete(0,this.tChart1.Series[0].Count);
this.tChart1.Refresh();
}
}
So, how should I do to get the sereis drawing like this?
On the 1st call: 0-1sec piece drawn.
On the 2nd call: 0-1sec piece + 1-2sec piece drawn.
On the 3rd call: 0-1sec piece + 1-2sec piece + 2-3sec piece
etc.