Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assigning values to TChart Width

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
Hi,

I've used the following lines of code to create and set the width of a TChart, which I've called memoryChart1.

memoryChart1 := TChart.Create(nil);
memoryChart1.Width := 600;
memoryChart1.Parent := Self;

No matter what size (I've tried 100, 300 and 600) I assign to memoryChart1.Width, it seems to have no effect. It always ends up being equal to 545. Is there some other setting that I need to turn off?

Your help would be much appreciated. Clive [infinity]
 
hi Clive

I've just tried your code and it works okay for me (I'm using D5). You haven't got an 'AlignToClient' anywhere, have you? Otherwise I don't know.

lou
 
I've solved it...it was a stupid mistake! It's because I had set the AutoSize property to true on the form that memoryChart1 was placed on. This meant that that the width was restricted so I set the AutoSize property to false and extended the form size and all is fine! Clive [infinity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top