Page 1 of 1
Treat Nulls problem in v.8.06
Posted: Tue May 11, 2010 6:45 am
by 10046032
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
Re: Treat Nulls problem in v.8.06
Posted: Tue May 11, 2010 12:14 pm
by yeray
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;
Re: Treat Nulls problem in v.8.06
Posted: Tue May 11, 2010 12:34 pm
by 10046032
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;
Re: Treat Nulls problem in v.8.06
Posted: Tue May 11, 2010 1:06 pm
by yeray
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 (11.69 KiB) Viewed 9225 times
But also note that in v2010 it seems to work fine:
- 2010.png (7.73 KiB) Viewed 9217 times
Anyway, I've added it to the defect list to be revised for future v8 maintenance releases (TV52014875).
Re: Treat Nulls problem in v.8.06
Posted: Tue May 11, 2010 1:11 pm
by 10046032
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
Re: Treat Nulls problem in v.8.06
Posted: Tue May 11, 2010 3:06 pm
by narcis
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
Have you tried the release version? Fully functional evaluation is available at the download area.
Re: Treat Nulls problem in v.8.06
Posted: Wed May 12, 2010 5:13 am
by 10046032
Hello,
I have not tried the evaluation version yet but I will do so
Regards
Re: Treat Nulls problem in v.8.06
Posted: Wed May 12, 2010 9:01 am
by yeray
Hi johnnix,
We've incorporated this to the actual v8 sources too, so this fix will be available with the next v8 maintenance release.