Is there a way to retrieve the width of the title frame when the form with the tchart component is hidden? Both the width and the rect of the title returns 0 when viewed. If not, is there another way it is possible to cut the length of a text to fit the frame without using "Adjust Frame"?
This is used for a webservice so the tchart component has to be hidden.
Width of a hidden title frame?
Hi,
you can get the width of the Title using the following code :
TittleWidth:=Chart1.Canvas.TextWidth(Chart1.Title.Text[0]);
you can get the width of the Title using the following code :
TittleWidth:=Chart1.Canvas.TextWidth(Chart1.Title.Text[0]);
Pep Jorge
http://support.steema.com
http://support.steema.com
Thanks for the response. This will give me the width of the text, but the text can be wider then the frame, if adjustframe is false. I can get the correct width of the frame with Chart1.Title.Width, but this will return "0" if the Chart is hidden.
Edit: I found a solution to the problem. If I call Chart1.Draw before I try to get the value from Chart1.Title.Width I will get the number I want. If there is some other way to only process the title frame I would appreciate the help, but this will do for now.
Edit: I found a solution to the problem. If I call Chart1.Draw before I try to get the value from Chart1.Title.Width I will get the number I want. If there is some other way to only process the title frame I would appreciate the help, but this will do for now.
Hi.
Using the Draw method to construct a chart "behind the scene" and then retrieve specific chart object size is a way to go.If I call Chart1.Draw before
Marjan Slatinek,
http://www.steema.com
http://www.steema.com