Possible BUG in TLineSeries.AddNull

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Joris Fontyn
Newbie
Newbie
Posts: 8
Joined: Tue Mar 16, 2004 5:00 am

Possible BUG in TLineSeries.AddNull

Post by Joris Fontyn » Fri Nov 05, 2004 4:42 pm

There is something wrong in de addnull method of TlineSeries. It probably came with the new Version 7 and still exists in verson 7.01.

The bug is that when using addnull, it actually calculates a different/wrong value of the non-null values (I use it for the bottom axis) .

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

Post by Pep » Fri Nov 05, 2004 5:06 pm

Hi Joris,

how can I reproduce the problem ?

Joris Fontyn
Newbie
Newbie
Posts: 8
Joined: Tue Mar 16, 2004 5:00 am

Post by Joris Fontyn » Fri Nov 05, 2004 5:18 pm

Below are some data, left column the X value, right column the Y data. If you use TLineSeries.AddNull the X-values are not correct.

Below is also part of the code that reads these values. The addnull was commented out to avoid the problem.

2 0.853
3 *
4 0.782
5 *
6 0.698
7 *
8 0.621
9 *
10 0.556
11 *
12 0.506
13 *
14 0.468
15 *
16 0.439
17 *
18 0.418
19 *
20 0.402
21 *
22 0.391
23 *
24 0.382
25 *
26 0.376
27 *
28 0.371
29 *
30 0.368
31 *
32 0.365
33 *
34 0.364
35 *
36 0.363


for x := MinX to MaxX do
begin
if (NSim[x, y] > 0)
then
begin
if (MainForm.CheckRegress.Checked = true) and (GraphForm.RGroupRegress.ItemIndex = 0)
then yy := (MeanSim[x, y] - GraphIcept) / GraphSlope
else yy := (MeanSim[x, y]);
if (LabelsIdx <> 0)
then Series[y - 1].AddXY(x, yy, MeanLabels[x], (Series[y - 1] as TLineSeries).Color)
else Series[y - 1].AddXY(x, yy, IntToStr(x), (Series[y - 1] as TLineSeries).Color);
if (MeanSim[x, y] > YAxisMax) then YAxisMax := MeanSim[x, y];
if (MeanSim[x, y] < YAxisMin) then YAxisMin := MeanSim[x, y];
end
else
begin
// if (LabelsIdx <> 0)
// then Series[y - 1].AddNull
// else Series[y - 1].AddNull;
end;
end;

Post Reply