Page 1 of 1

Query related to actual width of annotation.

Posted: Wed Jun 24, 2020 5:23 pm
by 9526439
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

Re: Query related to actual width of annotation.

Posted: Mon Jul 06, 2020 9:31 am
by yeray
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