Page 1 of 1

Set Max Rows/Series in Legend

Posted: Wed Dec 18, 2013 3:56 pm
by 10546456
I am trying to use TeeChart VCL (v8.06) with a legend scroll bar within Delphi 2010. I want to manually set the maximum number of rows to be visible in the legend and then be able to scroll amongst all series in the chart, but I can't see a way to do this. I tried setting the Legend Rectangle size using the OnGetLegendRect event but this only controls the legend box. The legend items seem to overflow the box.

Can you offer any advice?

Thanks!

Re: Set Max Rows/Series in Legend

Posted: Fri Dec 20, 2013 10:44 am
by yeray
Hello,

There's the Legend's MaxNumRows property for that.
I see it didn't work fine with v8 but it works fine with the actual version.
MaxNumRows.png
MaxNumRows.png (5.02 KiB) Viewed 4106 times

Code: Select all

uses Series, TeeLegendScrollBar;

var Chart1: TChart;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1:=TChart.Create(Self);
  Chart1.Parent:=Self;

  Chart1.View3D:=false;

  for i:=1 to 50 do
    Chart1.AddSeries(TPointSeries);

  Chart1.Tools.Add(TLegendScrollBar);

  Chart1.Legend.MaxNumRows:=10;
end;

Re: Set Max Rows/Series in Legend

Posted: Fri Dec 20, 2013 2:18 pm
by 10546456
Thanks, but when you say "actual" version do you mean "some version after 8.06"?

Happy Holidays!

Re: Set Max Rows/Series in Legend

Posted: Fri Dec 20, 2013 2:51 pm
by yeray
Hi,

Yes, I mean the latest, v2013.09.
Actually, I've also seen the property worked fine in v2010.00, the next release after v8.

Happy ones for you too! :)