Page 1 of 1

[TChartLegend] Switch horizontal - vertical

Posted: Wed Sep 13, 2006 3:04 pm
by 9343260
Hello,

When you set the TChartLegend.Alignment property to laTop, the legend switch to a "horizontal look". In my program, sometimes I need to set the legend back to CustomPosition, but I would like to set it again in a vertical mode.

Is there a way to switch between those vertical and horizontal mode ?

Posted: Thu Sep 14, 2006 9:54 am
by narcis
Hello bertrod,

I think the easiest way to achieve that is before setting a custom position aligning the legend to a vertical position, for example:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin
  Chart1.Legend.Alignment:=laRight;
  Chart1.Legend.CustomPosition:=true;

  Chart1.Legend.Left:=100;
  Chart1.Legend.Top:=100;
end;

Posted: Thu Sep 14, 2006 11:18 am
by 9343260
Ok, I thought there was a "cleaner" way. But i'll do as you suggest then. Thanks.