A
Amranullah
Guest
I have a chart in my windows form which X-axis linked whit text box, containing names of elements and Y-axis linked whit text-boxes, containing numeric values.
when I debug the form columns (bars) are close together and from 5 columns just one column takes a name.
Also when the same names come in text-boxes the program give message " A chart element with the name "......." already exists in the SeriseCollection". how to solve this issue?
I have tried the following code:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
Me.Chart1.Series.Clear()
Me.Chart1.Series.Add(Form3.TextBox6.Text)
Me.Chart1.Series.Add(Form3.TextBox17.Text)
Me.Chart1.Series.Add(Form3.TextBox23.Text)
Me.Chart1.Series.Add(Form3.TextBox29.Text)
Me.Chart1.Series.Add(Form3.TextBox35.Text)
Me.Chart1.Series(Form3.TextBox6.Text).Points.AddXY(Form3.TextBox6.Text, Val(Form3.txtpi1.Text))
Me.Chart1.Series(Form3.TextBox17.Text).Points.AddXY(Form3.TextBox17.Text, Val(Form3.txtpi2.Text))
Me.Chart1.Series(Form3.TextBox23.Text).Points.AddXY(Form3.TextBox23.Text, Val(Form3.txtpi3.Text))
Me.Chart1.Series(Form3.TextBox29.Text).Points.AddXY(Form3.TextBox29.Text, Val(Form3.txtpi4.Text))
Me.Chart1.Series(Form3.TextBox35.Text).Points.AddXY(Form3.TextBox35.Text, Val(Form3.txtpi5.Text))
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
Beep()
End Try
End Sub
Continue reading...
when I debug the form columns (bars) are close together and from 5 columns just one column takes a name.
Also when the same names come in text-boxes the program give message " A chart element with the name "......." already exists in the SeriseCollection". how to solve this issue?
I have tried the following code:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
Me.Chart1.Series.Clear()
Me.Chart1.Series.Add(Form3.TextBox6.Text)
Me.Chart1.Series.Add(Form3.TextBox17.Text)
Me.Chart1.Series.Add(Form3.TextBox23.Text)
Me.Chart1.Series.Add(Form3.TextBox29.Text)
Me.Chart1.Series.Add(Form3.TextBox35.Text)
Me.Chart1.Series(Form3.TextBox6.Text).Points.AddXY(Form3.TextBox6.Text, Val(Form3.txtpi1.Text))
Me.Chart1.Series(Form3.TextBox17.Text).Points.AddXY(Form3.TextBox17.Text, Val(Form3.txtpi2.Text))
Me.Chart1.Series(Form3.TextBox23.Text).Points.AddXY(Form3.TextBox23.Text, Val(Form3.txtpi3.Text))
Me.Chart1.Series(Form3.TextBox29.Text).Points.AddXY(Form3.TextBox29.Text, Val(Form3.txtpi4.Text))
Me.Chart1.Series(Form3.TextBox35.Text).Points.AddXY(Form3.TextBox35.Text, Val(Form3.txtpi5.Text))
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
Beep()
End Try
End Sub
Continue reading...