FastLineSeries Problem

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Neil Stainton
Newbie
Newbie
Posts: 4
Joined: Mon Sep 17, 2007 12:00 am
Location: Royal Leamington Spa
Contact:

FastLineSeries Problem

Post by Neil Stainton » Mon Feb 25, 2008 5:16 pm

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

Neil Stainton
Newbie
Newbie
Posts: 4
Joined: Mon Sep 17, 2007 12:00 am
Location: Royal Leamington Spa
Contact:

Additional experiments

Post by Neil Stainton » Mon Feb 25, 2008 5:33 pm

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Feb 25, 2008 7:24 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Neil Stainton
Newbie
Newbie
Posts: 4
Joined: Mon Sep 17, 2007 12:00 am
Location: Royal Leamington Spa
Contact:

Post by Neil Stainton » Tue Feb 26, 2008 11:15 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Feb 26, 2008 12:54 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Neil Stainton
Newbie
Newbie
Posts: 4
Joined: Mon Sep 17, 2007 12:00 am
Location: Royal Leamington Spa
Contact:

Another solution?

Post by Neil Stainton » Tue Feb 26, 2008 1:06 pm

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?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Feb 28, 2008 11:33 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue May 12, 2009 11:40 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply