Hi all.
This is an example code which works properly and plots an xy series of dots/lines.
Here's the results safe and easy:Code:Public Class Form2 Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick Label1.Text = Val(Label1.Text) + 1 Chart1.Series(0).Points.AddXY(Val(Label1.Text), TrackBar1.Value) End Sub End Class
However, to show a line chart in a usercontrol same code (In a try catch) will cause following exception:
"Index was out of range. Must be non-negative and less than size of collection. Parameter name: index" Series1 is OK in term of name, checked.
"A chart element with the name 'Series1' could not be found in the 'SeriesCollection'." Integer id same as example code.
* Both way were tried. Nothing achieved.
Any clues? Is there another way/method to add point in x and y?




Reply With Quote
