Page 1 of 1

FastLine plotting broken in v2011.04.41003 32bit

Posted: Thu Nov 17, 2011 5:48 am
by 16558915
Hello,

It seems that TFastLine series plotting is broken in the latest Beta, if DrawAllPoints := False and Null values are used.

Also in some cases panning operation raises and exception RangeError with the stack trace:
============================================
Series.TFastLineSeries.GetLastYMaxIndex(4211962)
Series.TFastLineSeries.GetLastYMaxIndex(-1)
Series.TFastLineSeries.CalcFirstLastVisibleIndex
TeEngine.DrawSeries($2056C40)
TeEngine.DoDraw(0,1,1)
TeEngine.DrawAllSeries
TeEngine.TCustomAxisPanel.DrawAxesSeries
============================================

Simple example to reproduce this problem:

In OnCreate handler use the code:

Code: Select all

{$DEFINE FAST}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Ch.BottomAxis.AutomaticMinimum := False;
  Ch.BottomAxis.Minimum := 0.0;
{$IFDEF FAST}
  Ch.AddSeries( TFastLineSeries );
  TFastLineSeries(Ch.Series[0]).TreatNulls := tnDontPaint;
  TFastLineSeries(Ch.Series[0]).DrawAllPoints := False;
{$ELSE}
  Ch.AddSeries( TLineSeries );
  TLineSeries(Ch.Series[0]).TreatNulls := tnDontPaint;
{$ENDIF}
  Ch.Series[0].AddXY( 1.0, -2.0 );
  Ch.Series[0].AddXY( 1.0, 2.0 );
  Ch.Series[0].AddNullXY( 1.25, 3.0 );
  Ch.Series[0].AddXY( 1.5, 1.0 );
  Ch.Series[0].AddXY( 1.8, 2.0 );
  Ch.Series[0].AddXY( 2.0, 1.0 );
  Ch.Series[0].AddXY( 2.4, 2.0 );
  Ch.Series[0].AddXY( 2.8, 1.0 );
  Ch.Series[0].AddXY( 3.1, 2.0 );
end;
1) Compare the result with FASTLINE defined and undefined.
2) Try panning operation and move the chart to the right (far enough!).

Regards,
Michael

Re: FastLine plotting broken in v2011.04.41003 32bit

Posted: Fri Nov 18, 2011 4:05 pm
by yeray
Hello Michael,
Miket1655 wrote:1) Compare the result with FASTLINE defined and undefined.
I could reproduce it so I've added it to the defect list to be fixed in future releases (TV52015897).
However, I've checked it with v2010.00, v2010.01, v2010.02, v2011.03, v2011.04 PreRelease and the actual sources and it looks the same in all them. So I don't think this has been broken recently. It looks more like a missing feature than a bug (meaning something broken that someday worked).
Miket1655 wrote:2) Try panning operation and move the chart to the right (far enough!).
This yes, it seem to be broken between v2011.03 and v2011.04. I've added it to the defect list to be fixed asap (TV52015898).

Re: FastLine plotting broken in v2011.04.41003 32bit

Posted: Tue Jun 05, 2012 9:23 am
by Marc
Status update

1) Not reproducible in tests on latest code, early June 2012.
2) Fixed for inclusion in next update.

Regards,
Marc Meumann

Re: FastLine plotting broken in v2011.04.41003 32bit

Posted: Tue Jun 05, 2012 10:28 am
by yeray
Hello Michael,

Let me clarify this:
Yeray wrote:
Miket1655 wrote:1) Compare the result with FASTLINE defined and undefined.
I could reproduce it so I've added it to the defect list to be fixed in future releases (TV52015897).
However, I've checked it with v2010.00, v2010.01, v2010.02, v2011.03, v2011.04 PreRelease and the actual sources and it looks the same in all them. So I don't think this has been broken recently. It looks more like a missing feature than a bug (meaning something broken that someday worked).
Marc wrote:1) Not reproducible in tests on latest code, early June 2012.
Reviewing this, I think it works as designed.
Your code adds two points at XValue=1, with YValues -2 and 2. And these points are followed by a null point.
- The TLineSeries (or a TFastLineSeries with DrawAllPoints=true) draws all the points even if they are drawn at the same x pixel. This is a vertical line for the first two points. Then, the line segment to the null point isn't drawn, etc.
- The TFastLineSeries with DrawAllPoints=false (and DrawAllPointsStyle=daFirst, by default) draws a unique point for all the values at the same x pixel. Since the next point is a null, no line segment is being drawn between them.