title: C# Chart - multiple curves but color gets overwritten
body: <p>So i'm displaying multiple curves in my chart. However, when i generate a random color, all the other curves will get this color too.</p>
  
  <pre><code>int fileIndex=0;
  Random r = new Random();
  foreach (var i in graphContainer)
  {
      fileIndex++;
      var series = new Series
      {
          Name                = legendNames[fileIndex],
          Color               = Color.FromArgb(r.Next(0, 256), r.Next(0, 256), r.Next(0, 256)),
          IsVisibleInLegend   = true,
          IsXValueIndexed     = false,
          ChartType           = SeriesChartType.Line
      };
      foreach (var j in i)
      {
          series.Points.AddXY (j.Item2, j.Item1);
      }
      chart.Invalidate        ();
      chart.Series.Add        (series);
  }
  </code></pre>
  
  <p>Note: all the curves except one has the same values, but you get the idea.
  <a href="https://i.stack.imgur.com/0uzRx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0uzRx.png" alt="enter image description here"></a></p>
  
  <p>Why is my curves getting the same colors?</p>
  
  <p>Entire function:</p>
  
  <pre><code>    private void generateWaveformsFromFileBtn_Click(object sender, EventArgs e)
      {
          int fileIndex                       = -1;
          string folder                       = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) + @"\WaveForms\";
          string filter                       = "*.csv";
          string[] filePath                   = Directory.GetFiles(folder, filter);
          List&lt;string&gt; legendNames            = new List&lt;string&gt;();
          List&lt;Tuple&lt;double, double&gt;&gt; graph   = new List&lt;Tuple&lt;double, double&gt;&gt;();
          List&lt;List&lt;Tuple&lt;double, double&gt;&gt;&gt; graphContainer = new List&lt;List&lt;Tuple&lt;double, double&gt;&gt;&gt;();
          chart.Series.Clear();
          foreach(var fileName in filePath) {
              legendNames.Add(Path.GetFileName(fileName));
              using (TextFieldParser csvParser = new TextFieldParser(fileName))
              {
                  csvParser.SetDelimiters (new string[] { ";" });
                  csvParser.ReadLine      ();
                  while (!csvParser.EndOfData)
                  {
                      string[] fields     = csvParser.ReadFields();
                      double current      = Double.Parse(fields[0]);
                      double inductance   = Double.Parse(fields[1]);
                      graph.Add           (new Tuple&lt;double,double&gt;(current, inductance));
                  }
                  graphContainer.Add(graph);
              }
          }
          Random r = new Random();
          foreach (var i in graphContainer)
          {
              fileIndex++;
              var series = new Series
              {
                  Name                = legendNames[fileIndex],
                  Color               = Color.FromArgb(r.Next(0, 256), r.Next(0, 256), r.Next(0, 256)),
                  IsVisibleInLegend   = true,
                  IsXValueIndexed     = false,
                  ChartType           = SeriesChartType.Line
              };
              foreach (var j in i)
              {
                  series.Points.AddXY (j.Item2, j.Item1);
              }
              chart.Invalidate        ();
              chart.Series.Add        (series);
          }
      }
  </code></pre>
  
  <p>Suggestion: (?)</p>
  
  <p><a href="https://i.stack.imgur.com/VCdT9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VCdT9.png" alt="enter image description here"></a></p>