Missing Chart Legend at runtime

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Bugsie
Newbie
Newbie
Posts: 15
Joined: Mon Jun 26, 2006 12:00 am
Location: Sydney

Missing Chart Legend at runtime

Post by Bugsie » Thu Oct 12, 2006 12:15 pm

I am using C++Builder 6 with Tee Chart Pro 7.07

I have this problem in two charts, one with Area Series and one with Line series.
I create up to 32 series at runtime, using a single series as a template. This works just fine (all the series do as expected), except the Legend which is visible at design time is not visible at runtime.

I have tried forcing it visible by setting

Chart->Legend->Visible = true;

and for each series:

for(i=0;i<NumUsed;i++){
LineSeries->ShowInLegend = true;
}

This does not help.!

I had this problem originally with an area chart, and worked around it by creating my own DIY Legend. I assumed it was a problem with my old version of TeeChart Pro (5 I think) Area Plots and the new release would fix the problem --- But alas it still happens to Area and Line charts

Is there something dumb I am doing -- have I missed something?

PS No problem with a pie chart and a bar chart -- The Legends appear OK
I must have spent days on this problem, trying different combinations.

Cheers
Bugsie :oops:

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

Post by Narcís » Fri Oct 13, 2006 10:39 am

Hi Bugsie,

This is very strange, it would seem there should be something that makes the legend not visible in your application. Could you please send us an example project we can run "as-is" to reproduce the problem here?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

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

Bugsie
Newbie
Newbie
Posts: 15
Joined: Mon Jun 26, 2006 12:00 am
Location: Sydney

Post by Bugsie » Fri Oct 13, 2006 2:35 pm

It would be difficult to send you the full app, as it runs on an Oracle database .. sigh. I will attempt to reproduce the problem in a simple example. I think I know how to do it, It requires runtime creation of series. It is late here tonight and I will try to make stand alone example tomorrow
Cheers
Bugsie.

PS I have one chart that works just fine without the problem.

Bugsie
Newbie
Newbie
Posts: 15
Joined: Mon Jun 26, 2006 12:00 am
Location: Sydney

Post by Bugsie » Sat Oct 14, 2006 3:52 am

Narcís,

I have posted a simpel test case example to news://www.steema.net/steema.public.attachments newsgroup.

Cheers
Chris McGowan
(Bugsie)

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

Post by Narcís » Wed Oct 18, 2006 9:50 am

Hi Chris,

Thank you very much for the project. It worked fine her using v7.07 and disabling the Build with run-time packages option at Project\Options\Packages. I'm attaching your project built here and its corresponding .exe in the newsgroups. Can you please test if it works fine for you?
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

Bugsie
Newbie
Newbie
Posts: 15
Joined: Mon Jun 26, 2006 12:00 am
Location: Sydney

Post by Bugsie » Wed Oct 18, 2006 11:03 am

Hi Narcís

Thanks for your help, Your App ran fine, I compiled it and it runs OK with Project\Options\Packages disabled.

I did the same thing with My main Application -- but it now has link errors (not related to Steema objects) when I disabledProject\Options\Packages !
I may be in "dll hell" :(

Also, my $TEE... Environment variables are set to the old version -- I will have a look at my environment and make sure all old dll's and libaries have been removed.

I will let you know when I have finished ....

Cheers
Chris

Bugsie
Newbie
Newbie
Posts: 15
Joined: Mon Jun 26, 2006 12:00 am
Location: Sydney

Post by Bugsie » Wed Oct 18, 2006 12:17 pm

Ok, I have got past my linking problem, .... sigh .... and have rebuilt my application. Unfortunatly the same problem exists -- no Legend at runtime.

I will check all my dll's and run time environment -- It could be this is where the problem is (I am picking up the wrong dll somewhere..)

Cheers Chris

Bugsie
Newbie
Newbie
Posts: 15
Joined: Mon Jun 26, 2006 12:00 am
Location: Sydney

Post by Bugsie » Thu Oct 19, 2006 12:08 am

I have it working fine now :)

It is a bit strange though.

In my original code when I created the series at runtime I set the ParentChart to NULL and set it correctly when I activated the series. This code was unnecessary, as setting Active and Visible to false was enough. It was like this

for(i=1;i<MAX;i++){
AreaSeries = new TAreaSeries(AreaChart);
AreaSeries->ParentChart = NULL;
AreaSeries->Active = false;
AreaSeries->Visible = false;
}

And when I activated the series I set
AreaSeries[Id]->ParentChart = AreaChart;
AreaSeries[Id]->Active = true;
AreaSeries[Id]->Visible = true;

Removing this fixes the problem, thus:

for(i=1;i<MAX;i++){
AreaSeries = new TAreaSeries(AreaChart);
// This may not be necessary!
AreaSeries->ParentChart = AreaChart;
AreaSeries->Active = false;
AreaSeries->Visible = false;
}

And when Activating ........
AreaSeries[Id]->Active = true;
AreaSeries[Id]->Visible = true;


I tried to reproduce this in the simle example but it fails to reproduce the problem. My guess is there is some sort of race condition the simple example does not reproduce.

Anyway, thanks for you help.

Post Reply