title: .NET Chart: How to add DataPoint with different member types than double?
body: <p>The namespace I'm looking at is <code>System.Windows.Forms.DataVisualization.Charting</code> in .NET Framework 3.5.</p>
  
  <p>I've constructed a <code>Chart</code> with name <code>chart1</code> and added a <code>Series</code> called <code>mySeries</code> to that chart.</p>
  
  <p>Within the Data section of that series in the designer, I have:</p>
  
  <pre><code>IsXValueIndexed --&gt; False
  Name --&gt; mySeries
  Points --&gt; (Collection)
  XValueType --&gt; DateTime
  YValuesPerPoint --&gt; 1
  YValueType --&gt; Int32
  </code></pre>
  
  <p>When I try to add <code>DataPoint</code>s to the series like this, it seems like I cannot add them with the x and y values of the appropriate type:</p>
  
  <pre><code>public void InitializeChart()
  {
      Series theSeries = chart1.Series["mySeries"];
  
      // MyData is of type List&lt;MyDatum&gt; and MyDatum has two members --
      //    one of type DateTime and another of type int
  
      foreach (MyDatum datum in MyData)
      {
          // I'd like to construct a DataPoint with the appropriate types,
          //    but the compiler wants me to supply doubles to dp
  
          DataPoint dp = new DataPoint(mySeries);
          dp.XValue = datum.TimeStamp;
          dp.YValue = datum.MyInteger;
  
          radiosConnectedSeries.Points.Add(dp);         
      }
  }
  </code></pre>
  
  <p>What am I missing?  Thanks as always! </p>