Page 1 of 1

NullPoint are not well displayed with TFastLineSeries

Posted: Wed Sep 28, 2005 1:46 pm
by 9339785
Hi,
I try to use null points with TFastLineSerie with IgnoreNull = FALSE. Normally the lines must not be drawn between points who encapsulate the null points .... but it doesn't work well as you can see here :
http://cjoint.com/?jCpUtd8p1x
The green trace is a TFastLineSerie and the red one is a TLineSeries. Has you can see, it only works well with TLineSeries.

Is this bug will be corrected in the next release who will be available soon ?

Thanks

Posted: Thu Sep 29, 2005 11:13 am
by narcis
Hi franckgar,

have you tried using the SetNull method as shown in the "Nulls and Stairs" example at the TeeChart features demo (All Features\Welcome!\Chart Styles\Standard\Fast Line). You'll find the TeeChart features demo at the TeeChart program group.

NullPoint are not well displayed with TFastLineSeries

Posted: Thu Sep 29, 2005 12:15 pm
by 9339785
In my program I'm using the function AddNullXY() to add a null point into my list. I tested with the function SetNull() but the result is the same : the behavior of TFastLineSeries and TLineSeries are not the same with the null points !!

I've just sent you an email with a demo program to show you the problem.

I'm waiting for your answer on the forum.

Regards
Franck

Posted: Fri Sep 30, 2005 9:19 am
by narcis
Hi Franck,

I didn't receive your project but I've been able to reproduce it and this is certainly a bug which I've added to our defect list to be fixed for future releases. In the meantime, a workaround is adding a Null point where the line should start to be drawn as shown here:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var
  i: Integer;
begin
  for i:=0 to 20 do
  begin
    if ((i=6) or (i=11)) then
    begin
      Series1.AddNull(i);
      if i=6 then Series2.AddNullXY(i+1,-20)
      else Series2.AddNullXY(i+1,-(i+1))
    end
    else
      if i<6 then
      begin
        Series1.Add(10);
        Series2.Add(-10);
      end
      else
        if i<11 then
        begin
          Series1.Add(20);
          Series2.Add(-20);
        end
        else
          begin
            Series1.Add(i);
            Series2.Add(-i);
          end;
  end;

  Series2.IgnoreNulls:=false;
end;

Posted: Thu Oct 20, 2005 2:52 pm
by 9339785
Hi Narcis,

I'm disappointed to see that this bug is not corrected into TeeChart v7.05 !!
As my program is designed, I can not use your solution to bypass this bug of the graph .... and I really need a solution.
As I have the source of TeeChart, could you indicate me where is the bug to let me correct it dirrectly ?

Thanks

Posted: Fri Oct 21, 2005 7:18 am
by narcis
Hi Franck,

I'm not sure about that because I haven't looked at it closely but the problem could be at Series.pas on procedure TFastLineSeries.DrawValue(ValueIndex:Integer);, specially at the second if at its else branch and the DoMove call.

Be careful if you modify the DoMove procedure as it is called at another method too.

Posted: Fri Oct 21, 2005 9:24 am
by 9339785
Thanks for you reply.
I've found a better and simple solution to resolve my problem.... I just move the last null point to the position of the next visible point.... so the line is even drawn but it is not visible as the two points are at the same position.

Franck

Posted: Fri Oct 21, 2005 10:03 am
by narcis
Hi Franck,

I'm glad to hear you found a workaround that works for you.