title: How to draw continuous line graph in vb.net
body: <p>I'm very new to VB.NET. I'm trying to draw continuous line graph based on certain time intervals using the graph UI control. I'm able to draw the graph the first time and getting unhandled exception on second time. Please refer to my code below,</p>
  
  <pre><code>Dim s As New Series
  
      s.Name = "aline"
  
      'Change to a line graph.
      s.ChartType = SeriesChartType.Line
  
      For index As Integer = 1 To 10
          s.Points.AddXY("1990", 27)
          s.Points.AddXY("1991", 15)
          s.Points.AddXY("1992", index)
      Next
      Chart1.Series.Add(s)
      Threading.Thread.Sleep(1000)
      s.Points.AddXY("1993", 27)
      s.Points.AddXY("1994", 15)
      s.Points.AddXY("1995", 10)
      Chart1.Series.Add(s)'Here im getting exception
  </code></pre>
  
  <p>But on second time if I try to update the values using <code>Chart1.Series.Add(s)</code>, I'm getting "A chart element with the name 'aline' already exists in the 'SeriesCollection'" error. Please guide how to update the values continuously.</p>