Page 1 of 1

FastLineSeries Problem

Posted: Mon Feb 25, 2008 5:16 pm
by 10546709
Hi,

We do implement scrolling of real-time FastLineSeries by adding points:

theChart.Series[0].Add(thePoints.Value, strPointsDate1 );

Any by deleting points after initial 60 points are added:
theChart.Series[0].Delete(0);

Each point is being added once per second and after 60 seconds the first point of the series is being removed.

Unfortunately after something between 60 and 120 secs we end up with points getting deleted faster than added.

Eventually we end up with just one point.

PS.

1. I've read the article: "Real-time charting in TeeChart VCL"

2. theChart.Series[0].Count=60, even though eventually we can only see one.

3. theChart.Series[0].DrawAllPoints = True

Additional experiments

Posted: Mon Feb 25, 2008 5:33 pm
by 10546709
Also tried it with the following settings:

theChart.Series[0].AutoRepaint := False;
theChart.Series[0].XValues.Order := loNone;

but it doesn't seem to make any difference.

Posted: Mon Feb 25, 2008 7:24 pm
by narcis
Hi Neil,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here? You could use a timer and random data for populating the series.

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Tue Feb 26, 2008 11:15 am
by 10546709
The files were posted using Steema's upload page. I think we've found a solution to the problem. You can figure out a solution without the full source code, just by looking at the code above. Hhowever, it would be interesting to see if you come up with the same solution, or maybe there's a better one than we already have?

/ Maciej Zagozda

Posted: Tue Feb 26, 2008 12:54 pm
by narcis
Hi Neil,

Thanks for the example project. I've found that changing this line:

Code: Select all

      theChart.Series[intA].Delete(0);
for this one:

Code: Select all

      theChart.Series[intA].Delete(0,1,true);
solves the problem here.

We will investigate if this is a bug or I'm missing something else.

Another solution?

Posted: Tue Feb 26, 2008 1:06 pm
by 10546709
Thank you for your prompt reply and the solution.

There shouldn't be any difference between:

Delete(0) and Delete(Start,Quantity,RemoveGap),

as above.

Appreciate the solution, but my collegue here suggested that the problem might be solved by a adding the points in a different way, not by improving the way of how we delete points.

What about theChart.Series.AddXY, does it look like another way of solving the problem?

Posted: Thu Feb 28, 2008 11:33 am
by narcis
Hi Neil,

Thanks for your feedback.

Yes, you are right, both Delete methods should behave in the same way here.

We have been reviewing the issue and we think there's a bug with Delete(ValueIndex) method. I've added this defect (TV52012856) to the bug list to be fixed for next releases.

The way you populate series seems fine to us.

Posted: Tue May 12, 2009 11:40 am
by narcis
Hi Neil,

I've been investigating this issue and found that it's not a bug. The problem here is that you are populating series without adding X values. Therefore, when removing first value in the series and swapping it with the second value it reaches a point where all x values in the series are the same. To solve this problem you need to populate series like this:

Code: Select all

  theChart[0].AddXY(thePoints.DateTime, thePoints.Temperature, strPointsDate1 + TeeLineSeparator + strPointsDate2  );
I'll send you the project you sent with the modifications I made to get this working.