Position of a SubChart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
WilliEbert
Newbie
Newbie
Posts: 26
Joined: Wed Aug 25, 2010 12:00 am

Position of a SubChart

Post by WilliEbert » Fri Oct 29, 2010 4:20 pm

Hello,
we have to position a SubChart outside the Chart Axis, e.g. under the Chart.Legend. Because the SubChart should not hide any info of the Main chart, but if we try this to position the SubChart under the Legend there are many problems :

procedure TGraphForm.ChartIntResize(Sender: TObject);
begin
ChartTool3.Charts[0].Chart.Left := ChartInt.Legend.Left -50 ;

ChartTool3.Charts[0].Chart.Top := ChartInt.Height - ChartTool3.Charts[0].Chart.Height -50 ;

end;

This code does not function well, because there is now way to deal with Form maximize and if only the Chart is resizing the SubChart is only following very slow the Main Chart Position.

Can you help us?

Your sincerely

Willi Ebert

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

Re: Position of a SubChart

Post by Narcís » Mon Nov 01, 2010 5:53 pm

Hi Willi,

Could you please attach a simple example project we can run "as-is" to reproduce the problem here?

Thanks in advance.
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

WilliEbert
Newbie
Newbie
Posts: 26
Joined: Wed Aug 25, 2010 12:00 am

Re: Position of a SubChart

Post by WilliEbert » Tue Nov 02, 2010 3:21 pm

Hello Narcís,
here is a test project. The SubChart stays not under the legend like it is defined in the Chart1Resize procedure.

Your sincerely

Willi
Attachments
SubChart.zip
(12.33 KiB) Downloaded 426 times

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

Re: Position of a SubChart

Post by Narcís » Tue Nov 02, 2010 3:52 pm

Hi Willi,

Implementing OnResize as shown below works fine for me here. Chart needs to be drawn so that legend properties have correct values.

Code: Select all

procedure TForm2.Chart1Resize(Sender: TObject);
begin
  Chart1.Draw;
  ChartTool1.Charts[0].Chart.Left := Chart1.Legend.Left -50 ;
  ChartTool1.Charts[0].Chart.Top := Chart1.Legend.ShapeBounds.Bottom;
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

WilliEbert
Newbie
Newbie
Posts: 26
Joined: Wed Aug 25, 2010 12:00 am

Re: Position of a SubChart

Post by WilliEbert » Tue Nov 02, 2010 5:12 pm

Hello Narcís,
thank you very much for your help. Chart1.Draw was the key.

Your sincerely

Willi Ebert

Post Reply