Page 1 of 1

TContourSeries - making art

Posted: Tue Nov 08, 2011 8:38 am
by 10550286
I have a display made of both TContourSeries and TColorGridSeries. It started hanging and I found out that when I feed in a (very) large array of data, with valid location values, but the data terms are all zero, then it hangs when I call Repaint.
I don't know which series flakes out the most about this.
In my experimenting I changed the zero value to be 5 and produced this lovely artwork that I've attached. I've now got a check in my code locally, so this won't happen again for me, but I thought I'd share.
If the data term is non-constant, then it returns to normal behavior.

Re: TContourSeries - making art

Posted: Wed Nov 09, 2011 9:29 am
by yeray
Hello Sam,

I think it's just the TContourSeries, not the TColorGridSeries. This is reproducing the hanging for me here:

Code: Select all

uses TeeSurfa;

var Contour: TContourSeries;

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

  Contour:=Chart1.AddSeries(TContourSeries) as TContourSeries;
  Contour.FillSampleValues(100);

  for i:=0 to Contour.Count-1 do
    Contour.YValue[i]:=0;
end;
I'm not sure about the meaning of having this series with all YValues as zero. Maybe you could explain it with a picture showing us the expected result, for example.

Re: TContourSeries - making art

Posted: Thu Nov 10, 2011 12:45 am
by 10550286
There is no meaning - it was an error for me to be trying to contour a constant value across the whole chart.
Nevertheless, I thought I'd report TChart's confusion on the matter.