Alright, I am going to post what I got so far...
The reason I am doing the step ladder approach is because I am going to place the text boxes under the points on the X axis so the graph looks like its scrolling. The goal of this graph is to update every second with the updated information.
Im having trouble importing the T however, it keeps coming back to me with the error message, "cannot use a string "" as an integer."
As always, anytips or advice would be appreciated.
vb Code:
Imports System.Windows.Forms.DataVisualization.Charting Public Class Form2 Dim chart1 As New Chart Shared Property T As Integer Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub TextBox11_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox10.TextChanged If T <= 2 Then Label1.Visible = False TextBox20.Text = TextBox21.Text TextBox31.Text = TextBox32.Text TextBox21.Text = TextBox22.Text TextBox32.Text = TextBox33.Text TextBox22.Text = Form1.TextBox10.Text TextBox33.Text = Form1.TextBox4.Text Dim s1() As Point = {New Point(T - 2, TextBox20.Text), New Point(T - 1, TextBox21.Text), New Point(T, TextBox22.Text)} Dim s2() As Point = {New Point(T - 2, TextBox31.Text), New Point(T - 1, TextBox32.Text), New Point(T, TextBox33.Text)} For x As Integer = T - 2 To T chart1.Series(0).Points.Add(x, s1(x).Y) Next chart1.Series.Add("Series2") chart1.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.Line chart1.Series(1).ChartType = DataVisualization.Charting.SeriesChartType.Line For x As Integer = T - 2 To T chart1.Series(1).Points.Add(x, s1(x).Y) Next chart1.Series(0).Label = "PSS" chart1.Series(1).Label = "USS" End If End Sub Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing If Form1.CheckBox1.Checked Then Form1.CheckBox1.Checked = False End Sub End Class




Reply With Quote