XY Chart NET 3 Control Reference
Annotations Property

XYChartNET contains an Annotations Collection.  Use this property to: 

Annotations uses the Annotations Class set of properties and methods to manipulate the collection.

Syntax
[Visual Basic]
Property Annotations() As C_Annotations
[C#]
XYChartNet.XYChartNETCtl.C_Annotations XYChartNETCtl.Annotations
[C++]
property XYChartNet::XYChartNETCtl::C_Annotations ^XYChartNet::XYChartNETCtl::Annotations
       
Example
' XYChartNETCtl1 is the name of the XY Chart NET control instance placed on the form.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim icount As Integer, idx As Integer
        Dim annType As XYChartNet.XYChartNETCtl.AnnotationTypes
        Dim annArrow As XYChartNet.XYChartNETCtl.C_anArrow
        Dim annText As XYChartNet.XYChartNETCtl.C_anText
        Dim annEllipse As XYChartNet.XYChartNETCtl.C_anEllipse
        Dim annObject As Object

        With XyChartNETCtl1
            'Create Annotations - Arrow, Text, and an Ellipse
            annObject = .Annotations.Add(XYChartNet.XYChartNETCtl.AnnotationTypes.anArrow)
            annArrow = annObject
            annArrow.Name = "MyArrow"
            annObject = .Annotations.Add(XYChartNet.XYChartNETCtl.AnnotationTypes.anText)
            annText = annObject
            annText.Name = "MyText"
            annObject = .Annotations.Add(XYChartNet.XYChartNETCtl.AnnotationTypes.anEllipse)
            annEllipse = annObject
            annEllipse.Name = "MyEllipse"

            'Modify Annotations
            icount = .Annotations.Count
            For idx = 0 To icount - 1
                annType = .Annotations.Type(idx)
                annObject = .Annotations.Item(idx)
                Select Case annType
                    Case XYChartNet.XYChartNETCtl.AnnotationTypes.anArrow
                        annArrow = annObject
                        With annArrow
                            .ArrowColor = Color.DarkRed
                            .ArrowStyle = XYChartNet.XYChartNETCtl.StyleOptions.soDashDotDot
                            .ArrowWidth = XYChartNet.XYChartNETCtl.WidthOptions.woTwoPoint
                            .Display = XYChartNet.XYChartNETCtl.ArrowOptions.arFrontFill
                            .Snap = False
                            .X1Val = 0.2
                            .X2Val = 0.4
                            .XScale = 0
                            .Y1Val = 0.3
                            .Y2Val = 0.5
                            .YScale = 0
                        End With
                    Case XYChartNet.XYChartNETCtl.AnnotationTypes.anEllipse
                        annEllipse = annObject
                        With annEllipse
                            .LineColor = Color.Green
                            .LineStyle = XYChartNet.XYChartNETCtl.StyleOptions.soSolid
                            .LineWidth = XYChartNet.XYChartNETCtl.WidthOptions.woTwoPoint
                            .Snap = False
                            .XVal = 0.4
                            .Width = 0.4
                            .XScale = 0
                            .YVal = 0.5
                            .Height = 0.2
                            .YScale = 0
                            .Fill.Visible = True
                            .Fill.SolidColor = Color.FromArgb(110, Color.Honeydew) 'Apply transparency
                        End With
                    Case XYChartNet.XYChartNETCtl.AnnotationTypes.anText
                        Dim myFont As Font = New Font("Courier", 16, FontStyle.Italic Or FontStyle.Underline)
                        annText = annObject
                        With annText
                            .Snap = False
                            .Rotation = -45
                            .Text = "Explore"
                            .TextColor = Color.Red
                            .XVal = 0.5
                            .XScale = 0
                            .YVal = 0.4
                            .YScale = 0
                            .TextFont = myFont
                        End With
                End Select
            Next
            .Refresh()
        End With
    End Sub
                       
                       
See Also

 

 


© 2003 - 2013 ControlEng Corporation. All rights reserved.