Page 1 of 1

Legend disappears

Posted: Wed Apr 28, 2010 6:17 pm
by 10546565
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

Re: Legend disappears

Posted: Fri Apr 30, 2010 2:28 pm
by narcis
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.

Re: Legend disappears

Posted: Fri Apr 30, 2010 2:45 pm
by narcis
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).

Re: Legend disappears

Posted: Fri Apr 30, 2010 2:50 pm
by 10546565
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?

Re: Legend disappears

Posted: Tue May 04, 2010 3:01 pm
by narcis
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.

Re: Legend disappears

Posted: Fri May 14, 2010 2:57 am
by 10546565
Yes. I am not sure how the line got into the DFM, but that fixes it.

Thanks
Ed Dressel

Re: Legend disappears

Posted: Fri Jul 23, 2010 2:54 pm
by 10046296
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