Query related to actual width of annotation.

TeeChart for ActiveX, COM and ASP
Post Reply
amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Query related to actual width of annotation.

Post by amol » Wed Jun 24, 2020 5:23 pm

Hi,
We are using Active X TChart 2018.
I am drawing annotation on tchart at run time with some text in it. The auto size property is set true. now when I am trying to get width of this annotation tool. I am getting the value zero.
Please suggest as to how I can get the actual width of annotation.

Thanks
Amol

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

Re: Query related to actual width of annotation.

Post by Yeray » Mon Jul 06, 2020 9:31 am

Hello,

This seems to work fine for me here:

Code: Select all

Private Sub Form_Load()  
  TChart1.AddSeries scPoint
  TChart1.Series(0).FillSampleValues
  
  TChart1.Tools.Add tcCursor
  TChart1.Tools.Items(0).asTeeCursor.Style = cssVertical
  TChart1.Tools.Items(0).asTeeCursor.AxisAnnotation.Shape.Show
  TChart1.Tools.Items(0).asTeeCursor.AxisAnnotation.AutoSize = True
End Sub

Private Sub TChart1_OnAfterDraw()
  Caption = TChart1.Tools.Items(0).asTeeCursor.AxisAnnotation.Shape.Width
End Sub
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