Contour fill problem
Posted: Thu Jul 24, 2008 3:01 pm
Hi,
I am using TeeChart Pro v8.02 VCL in Delphi6
I am trying to use the ContourSeries and fill the contours as is done in the TeeDemo program (see Tee8New -> Welcome->New In Series -> Contour -> Filled). This works ok if the series data comes from FillSampleValues BUT when I fill the data by reading an ASCII file the data are cleared when I execute this code: ContourSeries1.Brush.Style:=bsClear
My test program is mostly copied section from the demos...
I use this routine to fill the contours:
If CheckBox1.Checked then
ContourSeries1.Brush.Style:=bsSolid
Else
ContourSeries1.Brush.Style:=bsClear;
and I use this to read the data:
begin
With SeriesTextSource1 do
begin
Series := SurfaceSeries1;
SeriesTextSource1.HeaderLines := 1;
Fields.Clear;
AddField('X',1);
AddField('Y',2);
AddField('Z',3);
FieldSeparator := #9;
DecimalSeparator := '.';
FileName := 'test.txt';
Active := True;
end;
ContourSeries1.DataSource := SurfaceSeries1;
end;
I have found that the only way to keep the data with a ContourSeries1.Brush.Style:=bsClear statement is to use a ContourSeries AND a SurfaceSeries in the same Chart. The SurfaceSeries can set set to not active. The data must be loaded into the SurfaceSeries (as in the above routine).
What I am really trying to do is fill only one of the contour levels. To do this I tried this:
procedure TForm1.ContourSeries1GetLevel(Sender: TContourSeries;
LevelIndex: Integer; var Value: Double; var Color: TColor);
begin
/ Only color Level 3
If (LevelIndex=1) then
Color:=clBlue
Else
Color := clNone
end;
This also only works if I fill the ContourSeries with FillSampleValues but... When I use real data (even when I load the data into a SurfaceSeries first) the statement Color := clNone does not work.
I am I doing something wrong or is this a bug?
Thanks,
Bob
I am using TeeChart Pro v8.02 VCL in Delphi6
I am trying to use the ContourSeries and fill the contours as is done in the TeeDemo program (see Tee8New -> Welcome->New In Series -> Contour -> Filled). This works ok if the series data comes from FillSampleValues BUT when I fill the data by reading an ASCII file the data are cleared when I execute this code: ContourSeries1.Brush.Style:=bsClear
My test program is mostly copied section from the demos...
I use this routine to fill the contours:
If CheckBox1.Checked then
ContourSeries1.Brush.Style:=bsSolid
Else
ContourSeries1.Brush.Style:=bsClear;
and I use this to read the data:
begin
With SeriesTextSource1 do
begin
Series := SurfaceSeries1;
SeriesTextSource1.HeaderLines := 1;
Fields.Clear;
AddField('X',1);
AddField('Y',2);
AddField('Z',3);
FieldSeparator := #9;
DecimalSeparator := '.';
FileName := 'test.txt';
Active := True;
end;
ContourSeries1.DataSource := SurfaceSeries1;
end;
I have found that the only way to keep the data with a ContourSeries1.Brush.Style:=bsClear statement is to use a ContourSeries AND a SurfaceSeries in the same Chart. The SurfaceSeries can set set to not active. The data must be loaded into the SurfaceSeries (as in the above routine).
What I am really trying to do is fill only one of the contour levels. To do this I tried this:
procedure TForm1.ContourSeries1GetLevel(Sender: TContourSeries;
LevelIndex: Integer; var Value: Double; var Color: TColor);
begin
/ Only color Level 3
If (LevelIndex=1) then
Color:=clBlue
Else
Color := clNone
end;
This also only works if I fill the ContourSeries with FillSampleValues but... When I use real data (even when I load the data into a SurfaceSeries first) the statement Color := clNone does not work.
I am I doing something wrong or is this a bug?
Thanks,
Bob