Contour fill problem

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Bob Yeatman
Newbie
Newbie
Posts: 18
Joined: Fri Nov 15, 2002 12:00 am

Contour fill problem

Post by Bob Yeatman » 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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Jul 28, 2008 9:29 am

Hi Bob,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here.

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Bob Yeatman
Newbie
Newbie
Posts: 18
Joined: Fri Nov 15, 2002 12:00 am

example program

Post by Bob Yeatman » Mon Jul 28, 2008 10:48 am

Hi,
Thanks much for the response. I will send an example program tonight (in about 9 hrs) when I get back.
Thanks,
Bob

Bob Yeatman
Newbie
Newbie
Posts: 18
Joined: Fri Nov 15, 2002 12:00 am

Test program uploaded

Post by Bob Yeatman » Mon Jul 28, 2008 2:56 pm

Hi,
While working through my test program I found some info on the forum suggesting that I can use "SeriesTextSource1.LoadFromFile" instead of
"SeriesTextSource1.Active := True"

This seems to stop the data from being cleared when I click the solid checkbox but...

With LoadFromFile the series colors seem to turn to black&white and the fill option no longer works.

Strange... I guess I must be something wrong!

Eventually, I would like to have only one level filled with color (see my "Fill only Level 3" checkbox).

Thanks for looking at this,
Bob

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jul 29, 2008 8:57 am

Hi Bob,

Thanks for the example project. I could reproduce the issue here and it seems a bug to me. I've added it (TV52013279) to the bug list to be fixed for next releases.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Bob Yeatman
Newbie
Newbie
Posts: 18
Joined: Fri Nov 15, 2002 12:00 am

Contour fill bug

Post by Bob Yeatman » Tue Jul 29, 2008 11:26 am

Hi,
Do you think this bug will be fixed in the near future?
If so, is there a way I can track this bug nr? I don't see tacking nrs in the "Lat est vision Information".

Is there a way to draw a region on the chart so I can manually fill in the contour segments? I can read each level and get the pixel coordinates to the contour segments... I would be more than happy if I could somehow use this data to draw a matching region on the plot so it looks like the contour segment is filled.
Thanks
Bob

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jul 29, 2008 12:02 pm

Hi Bob,
Do you think this bug will be fixed in the near future?
I can't give you an estimate date. However, I've added this is as a high priority item and since there are other contour fill related issues, I imagine that it's likely to be fixed sometime soon.
If so, is there a way I can track this bug nr? I don't see tacking nrs in the "Lat est vision Information".
We haven't done so with current VCL. However we started including issue tracking numbers in the release notes with other TeeChart versions releases and also have done so for v8.03 which currently is in release candidate stage. I'll send you an e-mail with the URL for downloading it.
Is there a way to draw a region on the chart so I can manually fill in the contour segments? I can read each level and get the pixel coordinates to the contour segments... I would be more than happy if I could somehow use this data to draw a matching region on the plot so it looks like the contour segment is filled.
You could try using Chart1.Canvas.Polygon method for that.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Bob Yeatman
Newbie
Newbie
Posts: 18
Joined: Fri Nov 15, 2002 12:00 am

Contour fill bug

Post by Bob Yeatman » Tue Jul 29, 2008 12:51 pm

Hi,
If I use the Canvas.Polygon method is it possible to do a fill with a semi-transparent color (set at 50% or so)?

I think TeeChart is a very powerful wonderful tool and the forum/support makes it priceless!

Thanks again for the help,
Bob

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jul 29, 2008 12:58 pm

Hi Bob,
If I use the Canvas.Polygon method is it possible to do a fill with a semi-transparent color (set at 50% or so)?
To achieve that you should use canvas blending as in the example I posted here:

http://www.teechart.net/support/viewtopic.php?t=3191
I think TeeChart is a very powerful wonderful tool and the forum/support makes it priceless!
Thank you very much :!:
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply