User (Legacy) Posted November 15, 2000 Report Share Posted November 15, 2000 I added : obj.ClearData (CD_EXTENSIONS) after obj is set. This clears any annotaions that were previously set up. I don't know if this is the best way, but it seems to work. "Paul Nailand" <nailand@onaustralia.com.au> wrote in message news:5MolsXwTAHA.1428@sfxserver.softwarefx.com... > Hi > > I use the following code (from the newsgroup) to add an annotation to my > chart > > How do I remove it afterwards? > I tried getting annotx.count but it was zero the next time i redrew my > chart, > > ----------- > > Steve, > Here's a way to annotate your chart using VB. > Make sure you set a reference to the Annotation Extension. > > > Private Sub Form_Load() > Dim obj As ChartFX > Dim AnnotX As AnnotationX > Dim c As AnnCircle > Dim i As Integer, j As Integer > Dim strAttach As String > > 'set reference to chart object on the form > Set obj = Me.ChartFX1.Object > > 'instanciate the annotation object > Set AnnotX = New AnnotationX > > 'turn off toolbar (unless you want it on) > Annotx.Toolbar = False > > 'add AnnotX to chart obj > obj.AddExtension AnnotX > > 'add an annotation circle > Set c = AnnotX.Add(OBJECT_TYPE_CIRCLE) > > 'turn off series point markers > obj.MarkerShape = MK_NONE > > 'pick you point to mark > i = 0 'series > j = 7 'point index > > 'size the circle > c.Width = 10 > c.Height = 10 > > 'set attach coordinates > strAttach = CStr(j + 1) & "," & CStr(obj.ValueEx(i, j)) > c.Attach ATTACH_CENTER, CStr(strAttach) > > 'what good is it without color > c.BkColor = obj.Series(i).Color 'back color > c.Color = obj.Series(i).Color 'border color > > Set c = Nothing > Set obj = Nothing > End Sub > > > Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.