Hi Les,
Attached as require - the total code is a project which can not put in the question
Attached part of the code which show the problem
Form10Chart is Form containing chart
DIm ut as double = 0.00005
Dim as double ub = 0.00007
Public Class Form10Chart
Public Class MyAnno Public SeriesFindex As Integer Public MTindex As string End Class
Private Sub Form10Chart_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim MyAnnos As New List(Of MyAnno)
Me.Chart1.Annotations.Clear()
Dim USS(3) As Double USS(0) = Math.Abs(ut * 1000000) USS(1) = Math.Abs(ub * 1000000) USS(2) = Math.Abs(ut * 1000000 * 1.5) USS(3) = Math.Abs(ub * 1000000 * 1.5) For Kmz As Integer = 0 To 3 Me.Chart1.Series("Interaction Diagram8").Points.AddXY(DF, USS(Kmz)) Dim ma As New MyAnno ma.SeriesFindex = Chart1.Series("Interaction Diagram8").Points.Count - 1 If Kmz = 0 Then ma.MTindex = "ut" ElseIf Kmz = 1 Then ma.MTindex = "ub" ElseIf Kmz = 2 Then ma.MTindex = "ut x 1.5" ElseIf Kmz = 3 Then ma.MTindex = "ub x 1.5" End If MyAnnos.Add(ma) Next For Findex As Integer = 0 To MyAnnos.Count - 1 Dim PC As New TextAnnotation With PC .ForeColor = Color.Red .Font = New Font("Tahoma", 10) .AnchorDataPoint = Chart1.Series("Interaction Diagram8").Points(MyAnnos(Findex).SeriesFindex) .X = Chart1.Series("Interaction Diagram8").Points(MyAnnos(Findex).SeriesFindex).XValue .Y = Chart1.Series("Interaction Diagram8").Points(MyAnnos(Findex).SeriesFindex).YValues(0) .Text = MyAnnos(Findex).MTindex.ToString '& " " & PC.AnchorDataPoint.ToString Chart1.Annotations.Add(PC) End With Next Me.Chart1.Refresh()
End Sub
End Class