Private Sub Calc() Dim PntList As List(Of KeyValuePair(Of Integer, Integer)) If Not PntList Is Nothing Then If Home_SF1.Text = "" Then Else If Home_SP1.Text = "" Then Else PntList.Add(New KeyValuePair(Of Integer, Integer)(Home_SF1.Text, Home_SP1.Text)) PC_SF1.Content = "Math.Round((Home_SP1.Text / Home_SF1.Text), 2) End If End If If Home_SF2.Text = "" Then Else If Home_SP2.Text = "" Then Else PntList.Add(New KeyValuePair(Of Integer, Integer)(Home_SF2.Text, Home_SP2.Text)) PC_SF2.Content = Math.Round((Home_SP2.Text / Home_SF2.Text), 2) End If End If If Home_SF3.Text = "" Then Else If Home_SP3.Text = "" Then Else PntList.Add(New KeyValuePair(Of Integer, Integer)(Home_SF3.Text, Home_SP3.Text)) PC_SF3.Content = Math.Round((Home_SP3.Text / Home_SF3.Text), 2) End If End If If Home_SF4.Text = "" Then Else If Home_SP4.Text = "" Then Else PntList.Add(New KeyValuePair(Of Integer, Integer)(Home_SF4.Text, Home_SP4.Text)) PC_SF4.Content = Math.Round((Home_SP4.Text / Home_SF4.Text), 2) End If End If DirectCast(myChart.Series(0), LineSeries).ItemsSource = PntList Else End If End Sub
|