Page 1 of 1

Problem with skipping nulls

Posted: Tue Jul 10, 2007 10:02 am
by 9339361
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

Posted: Tue Jul 10, 2007 10:20 am
by 9339361
Nevermind, I believe I have solved the problem, by setting
Series1.XValues.Order := loNone;

Posted: Tue Jul 10, 2007 10:50 am
by 9339361
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

Posted: Mon Jul 30, 2007 2:33 pm
by Pep
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;