Treat Nulls problem in v.8.06

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
johnnix
Advanced
Posts: 192
Joined: Tue Jul 10, 2007 12:00 am

Treat Nulls problem in v.8.06

Post by johnnix » Tue May 11, 2010 6:45 am

Hello,

I have a chart with a custom axis and 2 TLine series, one assigned to bottom axis and the other to custom. When adding null values (using AddNullXY) to the line series with the custom axis the first null value I add is displayed although the Treat Nulls selection is set to Don't Paint. Can you please take a look at this?

Regards

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Treat Nulls problem in v.8.06

Post by Yeray » Tue May 11, 2010 12:14 pm

Hi johnnix ,

I can't reproduce it with the following code. Could you please modify it so we can reproduce it here? Or could you please send us a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.

Code: Select all

uses series;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.View3D:=false;

  Chart1.CustomAxes.Add;
  Chart1.CustomAxes[0].Horizontal:=true;
  Chart1.Axes.Bottom.EndPosition:=49;
  Chart1.CustomAxes[0].StartPosition:=51;

  Chart1.AddSeries(TLineSeries.Create(self));
  Chart1[0].Add(Random*100);
  for i:=1 to 5 do
    Chart1[0].Add(Chart1[0].YValue[i-1] + Random*10 - 5);

  Chart1.AddSeries(TLineSeries.Create(self));
  Chart1[1].CustomHorizAxis:=Chart1.CustomAxes[0];
  Chart1[1].AddNullXY(0,Random*100); //First point, null
  for i:=1 to Chart1[0].Count-1 do
    Chart1[1].Add(Chart1[1].YValue[i-1] + Random*10 - 5);
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

johnnix
Advanced
Posts: 192
Joined: Tue Jul 10, 2007 12:00 am

Re: Treat Nulls problem in v.8.06

Post by johnnix » Tue May 11, 2010 12:34 pm

Hello,

Ok, here it is........ It looks like that the inverted property causes the error

Code: Select all

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
  Chart1.CustomAxes[0].Inverted := TCheckBox(Sender).Checked;
end;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.View3D:=false;

  Chart1.Series[0].XValues.Order := loNone;
  Chart1.Series[0].YValues.Order := loNone;

  Chart1.Series[0].AddXY(1.2,1);
  Chart1.Series[0].AddXY(1.5,2);
  Chart1.Series[0].AddXY(3.2,3);
  Chart1.Series[0].AddXY(2.2,4);
  Chart1.Series[0].AddNullXY(0,5);

end;

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Treat Nulls problem in v.8.06

Post by Yeray » Tue May 11, 2010 1:06 pm

Hi johnnix,

Using even more simple code:

Code: Select all

uses series;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;

  Chart1.AddSeries(TLineSeries.Create(self));
  Chart1[0].Add(1);
  Chart1[0].Add(2);
  Chart1[0].Add(3);
  Chart1[0].Add(4);
  Chart1[0].AddNull(5);

  Chart1.Axes.Bottom.Inverted:=true;

  Chart1.Axes.Left.SetMinMax(1,5);
end;
I can see the following result in v8.06 and 8.07:
8.07.png
8.07.png (11.69 KiB) Viewed 9104 times
But also note that in v2010 it seems to work fine:
2010.png
2010.png (7.73 KiB) Viewed 9096 times
Anyway, I've added it to the defect list to be revised for future v8 maintenance releases (TV52014875).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

johnnix
Advanced
Posts: 192
Joined: Tue Jul 10, 2007 12:00 am

Re: Treat Nulls problem in v.8.06

Post by johnnix » Tue May 11, 2010 1:11 pm

Hello,

I would very much appreciate any quick fix instructions (I am a source code customer). I do not wish to upgrade to v.2010 yet as I notice some problems with PngComponents when playing with the beta version and I cannot risk it at this point :wink:

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

Re: Treat Nulls problem in v.8.06

Post by Narcís » Tue May 11, 2010 3:06 pm

Hi johnnix,
I would very much appreciate any quick fix instructions (I am a source code customer).


In Series.pas, at TCustomSeries.DrawValue change this:

Code: Select all

    //TV52013890
    if (ValueIndex>0) and (IsNull(ValueIndex-1)) then { if null }
    if FTreatNulls=tnDontPaint then
    begin
      OldX:=X;
      OldY:=Y;
    end;
to this:

Code: Select all

    if OldColor=clNone then { if null }
    if FTreatNulls=tnDontPaint then
    begin
      OldX:=X;
      OldY:=Y;
    end;
I do not wish to upgrade to v.2010 yet as I notice some problems with PngComponents when playing with the beta version and I cannot risk it at this point :wink:
Have you tried the release version? Fully functional evaluation is available at the download area.
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

johnnix
Advanced
Posts: 192
Joined: Tue Jul 10, 2007 12:00 am

Re: Treat Nulls problem in v.8.06

Post by johnnix » Wed May 12, 2010 5:13 am

Hello,

I have not tried the evaluation version yet but I will do so

Regards

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Treat Nulls problem in v.8.06

Post by Yeray » Wed May 12, 2010 9:01 am

Hi johnnix,

We've incorporated this to the actual v8 sources too, so this fix will be available with the next v8 maintenance release.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply