Page 1 of 1

Transparency for map polygons

Posted: Wed Sep 30, 2009 5:53 pm
by 10549917
If one creates a map graph and defines that the polygons should be transparent, this gets ignored. The only way to get a transparent view is to have a TeeCpmmander and manually go in and set the series transparency after creating the chart.

Bruce

Re: Transparency for map polygons

Posted: Thu Oct 01, 2009 8:28 am
by yeray
Hi Bruce,

This seems to work as expected:

Code: Select all

var map1: TMapSeries;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  map1 := TMapSeries.create(self);
  Chart1.AddSeries(map1);
  map1.FillSampleValues(25);

  for i:=0 to map1.Count-1 do
    map1.Polygon[i].Transparency := 50;
end;
Could you please send us a simple example project we can run as-is to reproduce the problem here?

Re: Transparency for map polygons

Posted: Fri Oct 02, 2009 9:33 am
by yeray
Hi Jeevan,

Thanks for the project. I'm afraid you forgot to send the Project1.dpr file but adding the Unit.pas to a new project I could reproduce the issue.

But, if I'm not wrong, if you open the chart editor at design time and deactivate and reactivate the map series transparency, the problem is solved.
I'm not sure on the steps to follow to reproduce the problem consistently. I mean, creating a new project and adding a map series at design time, I can activate and deactivate its transparency with no problem. And your form doesn't seem too much modified.

Re: Transparency for map polygons

Posted: Fri Oct 02, 2009 1:02 pm
by 10549917
Yeray
I am not sure how you get it to work. I can't do so with the code I sent. I am using BDS2006 with TeeChart VCL 8.0.5. Have you made some changes in 8.0.6 that could explain the different behaviour?

Just to confirm what I get, when I run the unit1.pas code I sent, I do not get transparent polygons when the map is first shown. If I go into TeeCommander, I see that the series is set to transparent (box is checked). If I uncheck and check the box in TeeCommander, the polygons become transparent, as expected.

Now, if I click on the buttton1, it should load new random polygon values (which it does). Sometimes (very infrequently), the polygons become transparent but most times I see the change in polygon values but they remain non-transparent. If I continue to click on button1, the transparency mostly stays off, even though in TeeCommander it shows it as being on.

When I have time, I will try installing version 8.0.6 to see whether this fixes things.

Thanks
Bruce

Re: Transparency for map polygons

Posted: Fri Oct 02, 2009 1:38 pm
by yeray
Hi Bruce,

Yes, I recommend you to upgrade to 8.06 although, as you can see in the release notes, this series shouldn't had suffered many changes.

Here is the code I'm using to create the map series:

Code: Select all

uses TeeSurfa, TeeMapSeries;

procedure TForm1.Button1Click(Sender: TObject);
var Series1: TMapSeries;
begin
  Chart1.ClearChart;
  Chart1.View3D := false;
  Series1 := TMapSeries.Create(self);
  Chart1.AddSeries(Series1);
  Series1.FillSampleValues(10);
  Series1.Transparent := true;
end;

Re: Transparency for map polygons

Posted: Fri Oct 02, 2009 2:46 pm
by 10549917
I tried using your code in a separate button event within my program and it works fine . This is still with version 8.0.5 and my own test code (which you have) still does not work. This seems to imply the the problem relates to mapseries which are hard-defined in the chart at design time. All very confusing, especially if, when you run my code you don't have the problem.

Bruce

Re: Transparency for map polygons

Posted: Fri Oct 02, 2009 3:37 pm
by yeray
Hi Bruce,

In a first attempt I could reproduce the issue, but I solved it opening the editor at design time and setting the series as solid and then as transparent again (unchecking and rechecking the checkbox, as said above). But I'm not able to reproduce it in a new project so that makes me think that for, some reason, the serialization in your project could miss something.

So I recommend you to delete your series and add it again, if possible, of even better I'd recommend you to create your series at runtime.

Re: Transparency for map polygons

Posted: Fri Oct 02, 2009 4:11 pm
by 10549917
Yeray
I have tried what you just described and it did not solve the problem. I have also tried this several times before starting this thread on the forum. I can reproduce it in a test program (the one I sent you) but also have it in other programs so it is not just something that has happened once.

It does seem that there is no problem when creating a series at runtime but I have multiple series which need to plot on top of each other in a specific order with various attributes. I could code this all but it is generally much easier to define at design time.

Thanks
Bruce

Re: Transparency for map polygons

Posted: Mon Oct 05, 2009 7:37 am
by yeray
Hi Bruce,

I've tried to reproduce the problem several times too, in different IDEs and different TeeChart versions but I've only reproduced it the first time. So I'm afraid I haven't been able to find a consistent way to reproduce it and this is a necessary step to identify the problem and fix it in the future.

If you find how to reproduce it consistently, please, let us know how. In the meanwhile, I'd recommend you to create your series at runtime to fully control them. And, if you arrive to reproduce the problem again creating the series at runtime, then it should be easy to be reproducible everywhere.

Re: Transparency for map polygons

Posted: Mon Oct 05, 2009 2:42 pm
by 10549917
Thanks, Yeray. Yes, I agree.

Bruce