title: c# chart1.Series.Clear()
body: <pre><code>for (int i = 0; i &lt; intarr.Length; i++)
  {
      Series series = this.chart1.Series.Add(strarr[i]);
  
      series.Points.Add(intarr[i]);
      series.XValueType = ChartValueType.Int32;
  }
  </code></pre>
  
  <p>This is my code and I have</p>
  
  <pre><code>chart1.Series.Clear();
  </code></pre>
  
  <p>at the top of the function I'm calling.
  The first time round, it's fine. However the second time I get this error</p>
  
  <pre><code>A chart element with the name 'NSW' already exists in the 'SeriesCollection'.
  </code></pre>
  
  <p>at this line</p>
  
  <pre><code>Series series = this.chart1.Series.Add(strarr[i]);
  </code></pre>
  
  <p>Thanks</p>