title: How to model a scrolling line graph in WPF?
body: <p>I'm trying to re-learn WPF and I've started a little project that has a line graph, kind of like the CPU performance one you would see in Taskmanager. The graph is basically a canvas that has a punch of lines added to it's children and is based on an Avalon sample I found here <a href="http://msdn.microsoft.com/en-us/library/aa480159.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa480159.aspx</a></p>
  
  <p>Currently, when I get to the far right edge of the graph I clear my data set and reset my x-coordinate back to zero and the graph starts redrawing from the left hand side after a clear.</p>
  
  <pre><code>y = value;
  x = x + 1;
  if (x == samples)
  {
      CpuGraphAnimation2d.Children.RemoveRange(0, samples);
      x = 0;
  }
  </code></pre>
  
  <p>What I want to do is have the graph 'scroll' to the left as new values arrive, and effectively have all the old values shuffle to the left and drop the left most value.</p>
  
  <p>What would be the most efficient way to achieve this effect in WPF?</p>