Page 1 of 1

how can i move annotation tool

Posted: Fri May 26, 2006 11:34 am
by 6925851
i have added annotation tool with some text on the chart but i want to move by means cursor and fix it at some place depends on my choice ..

pls advise me on this
aravind

Posted: Fri May 26, 2006 11:40 am
by narcis
Hi Aravind,

To be able to move the tool around you'd better use Rectangle tool instead of Annotation tool.

How add annotation To Graph

Posted: Tue Jun 06, 2006 11:47 am
by 9531181
Hi,

I am also facing problem related to add annotation on the TeeChart,
I want to add annotation at specific X,Y point ,
Help me in this Regard

thanks & Regards

Posted: Tue Jun 06, 2006 11:59 am
by narcis
Hi Faizullah,

You can use the OnBeforeDrawAxes event and something like this:

Code: Select all

Private Sub TChart1_OnBeforeDrawAxes()
With TChart1.Tools.Items(0).asAnnotation.Shape
    .CustomPosition = True
    .Top = (TChart1.Series(0).CalcYPos(2) + TChart1.Series(0).CalcYPos(3)) / 2
    .Left = (TChart1.Series(0).CalcXPos(2) + TChart1.Series(0).CalcXPos(3)) / 2
  End With
End Sub

Posted: Tue Jun 13, 2006 4:49 am
by 9531181
Hi
Thanks.
It displays the Annote Text under the sprcific Point , I want to display the
annotation text above the Point (Top and Right Allign) ,
help me in this regards

Posted: Tue Jun 13, 2006 8:27 am
by narcis
Hi Faizullah,

Then you can do something like this:

Code: Select all

Private Sub Form_Load()
    TChart1.Series(0).FillSampleValues 10
    TChart1.Environment.InternalRepaint
End Sub

Private Sub TChart1_OnAfterDraw()
    With TChart1.Tools.Items(0).asAnnotation.Shape
        .CustomPosition = True
        .Top = TChart1.Series(0).CalcYPos(3) - TChart1.Tools.Items(0).asAnnotation.Height
        .Left = TChart1.Series(0).CalcXPos(3)
    End With
End Sub