Page 1 of 1

How to draw an arrow on top of a point

Posted: Mon Jun 30, 2008 11:53 am
by 9333771
Hi,

I need to draw some small vertical arrow (with a text on top) on top of a candle. The purpose is to add some extra info for a candle. The arrow should “stay” with the candle when the user zooms/scrolls. Also the arrow can be on top or on the bottom of the candle.

The find x,y / draw text part are ok. (I use TAnnotationTool / CalcXPos-Value & OnZoom)

But I don’t know how to draw an arrow.

Since the drawLineTool cannot draw arrow head,
I was thinking about making a child of TDrawLinesTool & TDrawLine to add info about the arrow style (mainly the anchor and the color) and rewrite the paint method. But it seems very complicated and long for something so basic.


Did I miss the magic tool that draws arrows?
Do you know a more simple way?
Do you have a tool "Follow-this-point/position-with-custom-draw" ?


thanks in advance for you help,


PS:
I use the .label to store the candle date.

Context:
winXP SP2,
TeeChart win 7.05 (with source)
Delphi Architect 9.0

Posted: Mon Jun 30, 2008 1:22 pm
by narcis
Hi Mariano,

You can achieve what you request using Annotation tool's callout and arrow as shown in the example at All Features\Welcome!\Tools\Annotation\Annotation Callout in the new features demo, available at TeeChart's program group. You can edit the tool and change callout's arrow head.

Posted: Tue Jul 01, 2008 7:12 am
by 9333771
perfect !

that exactly what I was looking for.

thanks.

found a bug (?)

Posted: Tue Jul 01, 2008 8:58 am
by 9333771
hi,

I did have a problem using the TAnnotationCallout.

you must reset
ChartTool1.Callout.Arrow.Visible := true;
in the form.OnCreate.
If not the arrow is visible on design time, but not during the execution.


see you,

Context:
winXP SP2,
TeeChart win 7.05 (with source)
Delphi Architect 9.0

Posted: Tue Jul 01, 2008 9:50 am
by yeray
Hi Mariano,

Yes you are right. We could reproduce it with latest v7 too.

As you say, the easiest workaround is forcing the property to true in OnCreate.

Finally, note that we tested it with v8 too and it works fine with it.