Hello,
I would like to have the chart dimension always the same even if the legend is hidden or not. How can i do to block the automatic autosize?
Regards
Chart dimension and legend
Re: Chart dimension and legend
Hi Calou,
The legend visible in one of the four default positions, adds an extra margin to the chart. So what you could do is to position the legend manually by the start. Something like following:
The legend visible in one of the four default positions, adds an extra margin to the chart. So what you could do is to position the legend manually by the start. Something like following:
Code: Select all
uses series;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.AddSeries(TLineSeries.Create(self));
Chart1[0].FillSampleValues(25);
Chart1.Legend.CustomPosition := true;
Chart1.MarginRight := 12;
Chart1.Draw;
Chart1.Legend.Left := Chart1.Axes.Bottom.IEndPos + 20;
Chart1.Legend.Top := Chart1.Axes.Left.IStartPos;
CheckBox1.Checked := true;
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
Chart1.Legend.Visible := CheckBox1.Checked;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |