ChartWidth and ChartHeight

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
RodneyB
Newbie
Newbie
Posts: 4
Joined: Tue May 08, 2007 12:00 am
Location: Australia

ChartWidth and ChartHeight

Post by RodneyB » Thu Aug 23, 2007 11:08 pm

Hi,
it appears that if I do the following;

Chart.Height := Screen.Height;
Chart.Width := Screen.Width;

the ChartHeight and ChartWidth are not calculated by TeeChart until the chart is completely redrawn.
I would really like to have these calculated without having to wait for the redraw to occur. I thought Chart.Update may do it for me but that didn't work.

1) is there a way (like calling Chart.Update) to update the ChartWidth and ChartHeight values before the chart repaints? or
2) is there a way of calculating it myself after setting the Chart.Height and Chart.Width?

Thanks

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 Aug 24, 2007 7:54 am

Hi RodneyB,

Yes, try using Draw method like this:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.Draw;
  Chart1.Height := Screen.Height;
  Chart1.Width := Screen.Width;
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