Re: Arranging data points
Start by getting the pairs into some list of( structure / class). Then you should be able to sort the items and add them to the chart. Also, look at one of the TryParse methods to convert the numeric information from text.
Re: Arranging data points
I have found a way to make it work. Can you suggest how I should tryparse my textboxes to finish this up?
Code:
Dim Points As New List(Of Point)
Dim P1 As New Point(Val(Me.TextBox1.Text), Val(Me.TextBox6.Text))
Dim P2 As New Point(Val(Me.TextBox2.Text), Val(Me.TextBox7.Text))
Dim P3 As New Point(Val(Me.TextBox3.Text), Val(Me.TextBox8.Text))
Dim P4 As New Point(Val(Me.TextBox4.Text), Val(Me.TextBox9.Text))
Dim P5 As New Point(Val(Me.TextBox5.Text), Val(Me.TextBox10.Text))
Points.Add(P1)
Points.Add(P2)
Points.Add(P3)
Points.Add(P4)
Points.Add(P5)
Dim SortedPoints As New List(Of Point)
SortedPoints = (From pnt In Points Order By pnt.X, pnt.Y).ToList
For Each GridPoint In SortedPoints
If GridPoint.X > 0 And GridPoint.Y > 0 Then
Me.Chart1.Series(0).Points.AddXY(GridPoint.X, GridPoint.Y)
End If
Next
Re: Arranging data points