title: WPF Toolkit DataVisualization. Specifying the X axis interval
body: <p>Im using the System.Windows.Controls.DataVisualization.Toolkit.dll supplied by the WPFToolkit.</p>
  
  <p>I have a chart displaying a list of dates on the X Axis and integers on the Y. </p>
  
  <p>XAML:</p>
  
  <pre><code>&lt;DVC:Chart Canvas.Top="80" Canvas.Left="10" Name="mcChart" Background="LightSteelBlue" Margin="12"&gt;          
      &lt;DVC:Chart.Series&gt;
          &lt;DVC:LineSeries Title="Lines" IndependentValueBinding="{Binding Path=Key}" DependentValueBinding="{Binding Path=Value}" /&gt;
      &lt;/DVC:Chart.Series&gt;
  &lt;/DVC:Chart&gt;
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>ObservableCollection&lt;KeyValuePair&lt;DateTime, int&gt;&gt; Data = new ObservableCollection&lt;KeyValuePair&lt;DateTime, int&gt;&gt;();
  Data.Add(new KeyValuePair&lt;DateTime, int&gt;(DateTime.Now.AddDays(-10), 100));
  Data.Add(new KeyValuePair&lt;DateTime, int&gt;(DateTime.Now.AddDays(-9), 200));
  Data.Add(new KeyValuePair&lt;DateTime, int&gt;(DateTime.Now.AddDays(-8), 500));
  
  ((LineSeries)mcChart.Series[0]).ItemsSource = Data;
  </code></pre>
  
  <p>Im binding the mcChart's ItemsSource to an <code>ObservableCollection&lt;int, DateTime&gt;</code></p>
  
  <p>When i have the chart containing enough data it displays each point on the X axis as a Date. ie. 2016-01-06, 2016-01-07, 2016-01-08 etc. </p>
  
  <p>However if i only have a few points displayed on the chart the intervals split up into hours. ie. 20:00, 00:00, 04:00, 08:00, 12:00, 16:00, 20:00</p>
  
  <p>How can i force it to only display date intervals on the X. </p>