exporting charts with legends in custom positions

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Richard Seaby
Newbie
Newbie
Posts: 58
Joined: Mon May 17, 2004 4:00 am
Contact:

exporting charts with legends in custom positions

Post by Richard Seaby » Fri Apr 20, 2007 9:17 am

If you position the legend (using custom) you can export the chart and all works well.

If you choose to reduce the size of the metafile then the legend disappears.

As far as I can understand it - it remains in the same position but as I have chosen to shrink the graph it has fallen off the canvas?

If you then place it on the right of the chart - it does not reduce in size in the same way as the chart - so you end up with a tiny graph and a big legend.

Richard

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Apr 20, 2007 1:40 pm

Hi Richard,

This is probably because instead of assigning an absolute position to the legend you should assign a relative position. The position could be relative to any series point, axes position, chart borders, etc.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Richard Seaby
Newbie
Newbie
Posts: 58
Joined: Mon May 17, 2004 4:00 am
Contact:

Post by Richard Seaby » Fri Apr 20, 2007 1:56 pm

I am just moving it using the two scroll edits in the tchart editor - is there some other way?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Apr 20, 2007 3:28 pm

Hi Richard,

Yes, you can do this programmatically:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.FillSampleValues();
  Chart1.Draw;

  With Chart1.Legend do
  begin
    CustomPosition:=true;
    Left:=Chart1.Axes.Left.PosAxis;
    Top:=Chart1.Axes.Left.IStartPos;
  end;
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply