Chart Height and Width

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
avp
Newbie
Newbie
Posts: 3
Joined: Mon Jan 14, 2008 12:00 am

Chart Height and Width

Post by avp » Wed Apr 08, 2009 2:42 pm

I placed on the form FMain: Chart1 (TChart) and Panel1 (TPanel) with Label1 and Label2 (TLabel). I used procedure TFMain.FormShow with two statements:
Label1.Caption:=IntToStr(Chart1.ChartHeight);
Label2.Caption:=IntToStr(Chart1.ChartWidth);
and procedure TFMain.Panel1Click with the same two statements.
However, at the start of my program, I obtain “0” and “0”, but when I click on Panel1, I obtain the actual height and the actual width of the Chart1. What is it? How I can obtain correct sizes of Chart1 right after the start of this program?
Last edited by avp on Fri Apr 10, 2009 12:49 am, edited 1 time in total.

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu Apr 09, 2009 8:40 am

Hi avp,

I think that you'll need to force the chart to be drawn a first time if you want retrieve info from it that won't be updated until it will be drawn.

Code: Select all

Chart1.Draw;
Label1.Caption:=IntToStr(Chart1.ChartHeight);
Label2.Caption:=IntToStr(Chart1.ChartWidth);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

avp
Newbie
Newbie
Posts: 3
Joined: Mon Jan 14, 2008 12:00 am

Chart Height and Width

Post by avp » Fri Apr 10, 2009 12:46 am

Tank you very much!

Post Reply