title: MS Charts C# Line Chart not accurate on data with gaps
body: <p>I have some code shown below that loops through a datagridview and graphs the data.  The problem I'm having is sometimes the data doesn't line up correctly when there are gaps.  I have multiple devices spitting data into my datagridview and sometimes the unit will not report for 2 reports, so there were be a gap in data but I still want my data to line up properly.  How do I achieve this?  The chart picture below will describe the issue better.  I'm using MSCharts, Winforms, C#, and .NET 4.</p>
  
  <pre><code>//for each column in my datagridview
  for (int i = 0; i &lt; currentDGV.Rows.Count; i++)
  {
       //for each column in each row in my datagridview
       for (int j = 2; j &lt; currentDGV.Columns.Count - 5; j++)
       {
           //make sure the column is visible and isnt a outlier
           if (currentDGV.Columns[j].Visible == true &amp;&amp;      (bool)currentDGV.Rows[i].Cells[OUTLIER_VALUE].Value != true)
           {
              string deviceName = currentDGV.Rows[i].Cells[DEVICE_NAME_VALUE].Value.ToString();
              string currentSize = currentDGV.Columns[j].HeaderText;
              string currentTime = currentDGV.Rows[i].Cells[DATETIME_VALUE].Value.ToString();
              string currentSizeValue = currentDGV.Rows[i].Cells[j].Value.ToString();
  
              createNewSeries(deviceName + " - " + currentSize);
              plotValueOnSeries(deviceName + " - " + currentSize, currentTime, currentSizeValue);
            }
        }
   }
  
  private void createNewSeries(String SeriesName)
      {
          if (tempChart != null)
          {
              if (tempChart.Series.IsUniqueName(SeriesName))
              {
                  tempChart.Series.Add(SeriesName);
                  //tempChart.Series[SeriesName].IsXValueIndexed = true;
                  //tempChart.Series[SeriesName].XValueType = ChartValueType.DateTime;
              }
          }
      }
  
      private void plotValueOnSeries(String SeriesName, string XValue, string YValue)
      {
          if (tempChart != null)
          {
              if (radioButtonStep.Checked == true)
                  tempChart.Series[SeriesName].ChartType = SeriesChartType.StepLine;
              else if (radioButtonSpline.Checked == true)
                  tempChart.Series[SeriesName].ChartType = SeriesChartType.Spline;
              else if (radioButtonPoint.Checked == true)
                  tempChart.Series[SeriesName].ChartType = SeriesChartType.Point;
              else
                  tempChart.Series[SeriesName].ChartType = SeriesChartType.Line;
  
              tempChart.Series[SeriesName].Points.AddXY(XValue, YValue);
          }
      }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/ITcjV.png" alt="MSChart"></p>