Legend disappears

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
TestAlways
Advanced
Posts: 228
Joined: Tue Aug 28, 2007 12:00 am
Location: Oregon, USA

Legend disappears

Post by TestAlways » Wed Apr 28, 2010 6:17 pm

8.06

I have a chart chart that I allow the user to select where they put the legend--top, left, right, bottom, via a popup menu.

This is a significant problem for me because there are laws for my software that there must be a legend.

It is very simple code.

Code: Select all

  if miLegendLeft.Down then
    chrtIncomeSources.Legend.Alignment := laLeft
  else
  if miLegendTop.Down then
    chrtIncomeSources.Legend.Alignment := laTop
  else
  if miLegendRight.Down then
    chrtIncomeSources.Legend.Alignment := laRight
  else
  begin
    chrtIncomeSources.Legend.Alignment := laBottom;
    if not miLegendBottom.Down then
      miLegendBottom.Down := True;
  end;
If the user selects right or left, there are not problems. But if the user selects top or bottom, the legend is not visible.

I reproduced it in a small example and have attached the code--right click over the chart and relocate the legend. When set to top or bottom, it does not display.

Ed Dressel
Attachments
LegendLocation.zip
Run in 8.06 and right click over the chart to move the legend--it does not display when it is set to top or bottom.
(5.17 KiB) Downloaded 610 times

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

Re: Legend disappears

Post by Narcís » Fri Apr 30, 2010 2:28 pm

Hi Ed,

I'm afraid you forgot to include project's .dpr file and I can not load the project. Can you please send it?

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

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

Re: Legend disappears

Post by Narcís » Fri Apr 30, 2010 2:45 pm

Hi Ed,

Forgot that I could add your unit to an empty project :oops:.

I found this is a bug in TeeChart Pro v8 VCL and checked that it works fine in v2010. I have added it to the defect list to be investigated (TV52014838).
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

TestAlways
Advanced
Posts: 228
Joined: Tue Aug 28, 2007 12:00 am
Location: Oregon, USA

Re: Legend disappears

Post by TestAlways » Fri Apr 30, 2010 2:50 pm

I cannot understate how big of a problem this is for me--it can result in lawsuits for my users and myself.

I have the source---can you tell me how it can be fixed?

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

Re: Legend disappears

Post by Narcís » Tue May 04, 2010 3:01 pm

Hi TestAlways,

Ok, I found that the problem is MaxNumRows property in your chart. Using code below works fine for me here. I wonder how did it got there as I can not reproduce the problem in a new application from scratch.

Code: Select all

constructor TForm77.Create(aOwner: TComponent);
begin
  inherited;
  chrtIncomeSources.Legend.MaxNumRows:=1;
  CreateBarSeries;
end;
Does this solve the problems at your end?

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

TestAlways
Advanced
Posts: 228
Joined: Tue Aug 28, 2007 12:00 am
Location: Oregon, USA

Re: Legend disappears

Post by TestAlways » Fri May 14, 2010 2:57 am

Yes. I am not sure how the line got into the DFM, but that fixes it.

Thanks
Ed Dressel

Drew
Newbie
Newbie
Posts: 11
Joined: Wed Aug 01, 2007 12:00 am
Location: UK

Re: Legend disappears

Post by Drew » Fri Jul 23, 2010 2:54 pm

I suffered exactly the same problem on two of my charts with Bottom aligned legends and having deleted the Legend.MaxNumRows=0 line from the DFM was able to see the legend again. This only happened for me when I upgraded to 8.06 from an earlier version.

But all working now so thanks for this thread - it saved me a lot of time trying to figure out what was causing it! :D

Drew

Post Reply