CAnnotationTool Custom Position

TeeChart for ActiveX, COM and ASP
Post Reply
nbp
Newbie
Newbie
Posts: 83
Joined: Mon Sep 18, 2006 12:00 am

CAnnotationTool Custom Position

Post by nbp » Wed Mar 18, 2009 9:27 pm

I'm trying to set various properties of CAnnotationTool via my code.

1) What property do I use to set the Custom Position on/off and also the Left and Top values of the Custom Position?

I'm using TChart V7 and Visual C++ 9.0

Thanks.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu Mar 19, 2009 8:59 am

Hi nbp,

To place your annotation in one of the predefined positions of your chart, you could use one of the following sentences:

Code: Select all

TChart1.Tools.Items(0).asAnnotation.Position = ppCenter
TChart1.Tools.Items(0).asAnnotation.Position = ppLeftBottom
TChart1.Tools.Items(0).asAnnotation.Position = ppLeftTop
TChart1.Tools.Items(0).asAnnotation.Position = ppRightBottom
TChart1.Tools.Items(0).asAnnotation.Position = ppRightTop
And to place it in a custom position, for example:

Code: Select all

  TChart1.Tools.Items(0).asAnnotation.PositionUnits = puPixels
  TChart1.Tools.Items(0).asAnnotation.Left = 200
  TChart1.Tools.Items(0).asAnnotation.Top = 300
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

nbp
Newbie
Newbie
Posts: 83
Joined: Mon Sep 18, 2006 12:00 am

Post by nbp » Wed Mar 25, 2009 6:32 pm

How do I know if the Annotation position is Custom or not? Is there a boolean flag associated with CAnnotationTool? I'm using TChart v7.

nbp
Newbie
Newbie
Posts: 83
Joined: Mon Sep 18, 2006 12:00 am

Post by nbp » Wed Mar 25, 2009 6:37 pm

In V7, I don't have access to Left and Top properties in CAnnotationTool

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu Mar 26, 2009 8:29 am

Hi nbp,

The boolean you are looking for:

Code: Select all

TChart1.Tools.Items(0).asAnnotation.Shape.CustomPosition = True
Are you sure that you have the latest v7 available? Here with TeeChart v7.0.1.4 I can use:

Code: Select all

TChart1.Tools.Items(0).asAnnotation.Left = 20
TChart1.Tools.Items(0).asAnnotation.Top = 50
or also:

Code: Select all

TChart1.Tools.Items(0).asAnnotation.Shape.Left = 20
TChart1.Tools.Items(0).asAnnotation.Shape.Top = 50
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply