Problem with skipping nulls

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Sigurdur I. Gunnlaugsson
Newbie
Newbie
Posts: 8
Joined: Fri Oct 01, 2004 4:00 am

Problem with skipping nulls

Post by Sigurdur I. Gunnlaugsson » Tue Jul 10, 2007 10:02 am

Hello.

I am using DBChart to store about 3x200K points (3 series). The series contain data sampled at different rates, therefore in some cases there are a lot of nulls. In previous versions, I deleted all nulls using loops, which is very slow when there are many nulls.

Now I would like to speed things up, using TeeChart v8's "Skip nulls", by setting
Series1.TreatNulls := tnSkip;
etc. All the series are TLineSeries.

Unfortunately, I am having some problems. It works fine until I start zooming in. Some strange lines seem to be drawn from the leftmost points to the rightmost point (even though the rightmost point is not visible).

Below are links to screenshots I have produced with my problem.

Screenshot 1. Before zooming in (seems all fine):
Image

Screenshot 2. After zooming in, a weird line is drawn.
Image

Screenshot 3. Moving a little to the right changes the weird line.
Image

Best regards,
Sigurdur

Sigurdur I. Gunnlaugsson
Newbie
Newbie
Posts: 8
Joined: Fri Oct 01, 2004 4:00 am

Post by Sigurdur I. Gunnlaugsson » Tue Jul 10, 2007 10:20 am

Nevermind, I believe I have solved the problem, by setting
Series1.XValues.Order := loNone;

Sigurdur I. Gunnlaugsson
Newbie
Newbie
Posts: 8
Joined: Fri Oct 01, 2004 4:00 am

Post by Sigurdur I. Gunnlaugsson » Tue Jul 10, 2007 10:50 am

Ehm, setting Series1.XValues.Order := loNone;
made Series1.VisibleCount stop working upon zooming.
Now it always returns the total number of points.
Is there any way to have both things working? :)

Regards,
Sigurdur

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jul 30, 2007 2:33 pm

Hi Sigurdur,

I'm afaid the only way is to calculate the number of visible points manually :

Code: Select all

procedure TForm1.Chart1Zoom(Sender: TObject);
var i, visiblepoints : integer;
begin

Visiblepoints :=0;
for i := 0 to Series1.Count-1 do
  if (Series1.XValues[i] >= Chart1.Axes.Bottom.Minimum) and
    (Series1.XValue[i] <= Chart1.Axes.Bottom.maximum) then
      inc(visiblepoints);
showmessage(inttostr(visiblepoints));
end;

Post Reply