title: Struggling with OxyPlot
body: <p>Been learning C#, and WPF for about 5 or 6 weeks now, and I'm working as an Intern on a project . Not doing to bad, but right now I'm stuck and I cant figure out why. Trying to migrate a WinForms application over to WPF. The old application used Z-graphs, written the code for OxyPlot, but my graphs arent showing and I have no idea why. </p>
  
  <p>XAML</p>
  
  <p><code>&lt;Border BorderBrush="{StaticResource chromeBrush}" BorderThickness="5 5 5 5" Margin="2 3 0 2" Grid.Column="3" Grid.ColumnSpan="36" Grid.Row="3" Grid.RowSpan="33" Background="Black"&gt;
                                                  &lt;DockPanel&gt;
                                                  &lt;DockPanel.DataContext&gt;
                                                      &lt;local:Main/&gt;
                                                  &lt;/DockPanel.DataContext&gt;
                                                  &lt;oxy:Plot Model="{Binding openPlot}" /&gt;
                                              &lt;/DockPanel&gt;
                                              &lt;/Border&gt;</code></p>
  
  <p>And the C#</p>
  
  <pre><code>public partial class Main : Window
  {
  
      public Dictionary&lt;string, DoorData&gt; doorList;
  
      public Main()
      {
          //this.InitializeComponent();
          doorList = new Dictionary&lt;string, DoorData&gt;();
  
      }
  
      public DoorData doorGraphs = new DoorData();
  
      private void unitList_SelectionChanged(object sender, SelectionChangedEventArgs e)
      {
          string selectedUnit = unitList.SelectedItem.ToString();
          doorGraphs = doorList[selectedUnit];
  
          this.Title = selectedUnit + " Open";
          PlotModel openPlot = new PlotModel();
  
          List&lt;SmartDDUOperation&gt; values = doorGraphs.Data;
          doorGraphs.FilterToType(SmartOperationType.Open);
          IEnumerable&lt;SmartDDUOperation&gt; drawOrder = values.OrderByDescending(x =&gt; x.TimeStamp);
  
          List&lt;LineSeries&gt; linePointsArray = new List&lt;LineSeries&gt;();
          foreach (SmartDDUOperation doorOp in drawOrder)
          {
              List&lt;Tuple&lt;double, double&gt;&gt; points = new List&lt;Tuple&lt;double, double&gt;&gt;();
              points = doorOp.GetTimePoints2();
              LineSeries linePoints = new LineSeries();
  
              foreach (Tuple&lt;double, double&gt; p in points)
              {
                  DataPoint XYPoint = new DataPoint(p.Item1, p.Item2);
                  linePoints.Points.Add(XYPoint);
              }
  
              linePointsArray.Add(linePoints);
          }
  
          LinearAxis Xaxis = new LinearAxis();
          Xaxis.Maximum = 6;
          Xaxis.Minimum = 0;
          Xaxis.Position = AxisPosition.Bottom;
          Xaxis.Title = "Time (s)";
          openPlot.Axes.Add(Xaxis);
  
          LinearAxis Yaxis = new LinearAxis();
          Yaxis.Maximum = 12;
          Yaxis.Minimum = 1;
          Yaxis.Position = AxisPosition.Left;
          Yaxis.Title = "Door Position";
          openPlot.Axes.Add(Yaxis);
  
          // Adds each series to the graph
  
          foreach (var series in linePointsArray)
          {
              openPlot.Series.Add(series);
          }
  
  
  
      }
  </code></pre>
  
  <p>Using the following namespaces...</p>
  
  <p><code>enter using OxyPlot;
  using OxyPlot.Annotations;
  using OxyPlot.Series;
  using OxyPlot.Axes;</code></p>
  
  <p>Like I said, only a beginner, so there is probably some obvious mistakes in there. Feel free to point them out and educate me.</p>
  
  <p>Thanks</p>