Page 1 of 1

Annotation draw

Posted: Thu May 12, 2005 9:05 pm
by 9340553
I am using a Annotation tool as a footer, with custom positioning. The position is set initially on chart creation, and whenever the chart is resized.

The tool is not displayed when the chart is first displayed, even though the OnResize() event is triggered. The reason is that the tool->Shape height is 1, even though there are three lines of text in the tool.

If the user then manually resizes the form (by any method), the tool is displayed, and stays in the correct location.

I tried OnAfterDraw, OnBeforeDrawSeries, and other events, but tool dimensions seem to be established after these events.



Posted: Fri May 13, 2005 7:55 am
by narcis
Hi Kevin,

Could you please send us an example we can run "as-is" to reproduce the problem here? You can post it at [url]news://[/url] newsgroup.

Also notice that TChart already has it's own footer which admits custom positioning, you could use it instead of TAnnotationTool. You can add a footer to your chart using the chart editor, "Titles" tab, selecting "Foot" in the left top listbox and finally select "Position" tab to set a custom position.

Posted: Sat May 14, 2005 10:01 pm
by 8578785

Sample code is posted.

I am aware of the TChart footer, but this text needs to be set and located programatically -- not by the user, and it needs to appear when the chart is displayed.

Note that the annotation tool displays correctly at first chart display when custom positioning is false.