Software FX Posted November 20, 2000 Report Share Posted November 20, 2000 Hi to remove a annotation object use "Remove Method". This method is used to remove an object from a group or from the entire annotation objects list. Object.Remove ObjectIndex where, Object is the variable holding the pointer to the annotation list or group. ObjectIndex is the index of the object you want to remove. -1 if you want to remove all objects. For example to remove the third object in the list: AnnotX.Remove 3 Regards, Percy Dyer Software FX, Inc. Tech Support Please reply to: Cfx98@softwarefx.com ================================================ "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 > > > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.