Page 1 of 1

ChartWidth and ChartHeight

Posted: Thu Aug 23, 2007 11:08 pm
by 9047006
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

Posted: Fri Aug 24, 2007 7:54 am
by narcis
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;