Aligning Left Axis for Multiple Charts
Aligning Left Axis for Multiple Charts
Hi,
Now I need to align the left axis on about 13 charts. This way looking at them all you could see the line ups for all the charts properly.
I didnt see anything in the features for it.
Thanks,
Tom
Now I need to align the left axis on about 13 charts. This way looking at them all you could see the line ups for all the charts properly.
I didnt see anything in the features for it.
Thanks,
Tom
Tom
Hi, Tom.
This has to be done manually through setting some of the axis/chart properties. Here is an example:
This has to be done manually through setting some of the axis/chart properties. Here is an example:
Code: Select all
procedure LeftAlignCharts(Const Charts: Array of TCustomChart; aLeft: Integer; aWidth: Integer);
var i: Integer;
begin
for i := Low(Charts) to High(Charts) do
// Left align charts
With Charts[i] do
begin
Left := aLeft;
Width := aWidth;
Margins.Left := 0;
Axes.Left.TitleSize := 15;
Axes.Left.LabelsSize := 30;
Axes.Left.LabelsAlign := alDefault;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
// ...
LeftAlignCharts([Chart1,Chart2],100,300);
end;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Tom,
Is that axis labels overlap with axis title? If so, try using custom labels size as told here.
Is that axis labels overlap with axis title? If so, try using custom labels size as told here.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
No the space between the labels and the title is fine. The letters for the title are overlapping eachother. On screen it looks fine but the drawmetatocanvas deal for printing seems to be causing it. I thin the strechtodraw might have something to do with it maybe.narcis wrote:Hi Tom,
Is that axis labels overlap with axis title? If so, try using custom labels size as told here.
Tom
Tom
Hi Tom,
it's difficult to know where is the problem without seeing the code. If you can send me a small app where I can see the problem (to pep@steema.com) and I'll take a look the code.
it's difficult to know where is the problem without seeing the code. If you can send me a small app where I can see the problem (to pep@steema.com) and I'll take a look the code.
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi Tom,
btw, are you changing the Title font size ?
If so, have you used Font.Height instead of Font.Size for font size ?
btw, are you changing the Title font size ?
If so, have you used Font.Height instead of Font.Size for font size ?
Pep Jorge
http://support.steema.com
http://support.steema.com
Pep,
Its almost like I need to do this:
But I do this it still doesnt seem to show up on the printout?
Thanks,
Tom
Its almost like I need to do this:
Code: Select all
Chart1.LeftAxis.Title.Font.InterCharSize := 3;
Thanks,
Tom
Tom
Hi Tom,
it's strange, I've test it here just printing a Chart with left axis title (setting interCharSize) and I get correct title printed (with correct separation), here is the code I used :
it's strange, I've test it here just printing a Chart with left axis title (setting interCharSize) and I get correct title printed (with correct separation), here is the code I used :
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.Axes.Left.Title.Caption:='my axis title';
Chart1.Axes.Left.Title.Font.InterCharSize:=3;
end;
procedure TForm1.Button2Click(Sender: TObject);
var tmpMeta: TMetafile;
begin
tmpMeta := Chart1.TeeCreateMetafile(True,Chart1.ClientRect);
try
// Printer.Orientation := poLandscape;
Printer.BeginDoc;
try
Printer.Canvas.StretchDraw(Rect(10,10,Printer.PageWidth - 10, Printer.PageHeight - 10),tmpMeta);
finally
Printer.EndDoc;
end;
finally
tmpMeta.Free;
end;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com