title: Take only some value from JavaFX ObservableList
body: <p>I need to build a </p>
  
  <pre><code>LineChart&lt;Number,Number&gt;
  </code></pre>
  
  <p>I had the data stored in</p>
  
  <pre><code>ObservableList&lt;MyData&gt;
  </code></pre>
  
  <p><code>MyData</code> had 4 variable, all of it are <code>int</code>. Let just say the variable in <code>MyData</code> are:  <code>No1, No2, No3, No4</code>. </p>
  
  <p>Next, I need to build</p>
  
  <pre><code>LineChart&lt;Number,Number&gt;
  </code></pre>
  
  <p>and I need only <code>No1</code> and <code>No2</code> variable, but I don't know how to take that value from <code>ObservableList</code>,  Now I just use <code>XYChart.Data</code> to add new data to <code>XYChart.Series</code> of my <code>LineChart&lt;Number,Number&gt;</code> like this:</p>
  
  <pre><code>private static XYChart.Series dataLineChart = new XYChart.Series();
  public static void updateDataChart(){
      dataLineChart.getData().addAll(
                  new XYChart.Data(3,15),
                  new XYChart.Data(7,20)
              );
  }
  </code></pre>
  
  <p>If only I can take the value from <code>ObservableList</code> I can just simply use :</p>
  
  <pre><code>private static XYChart.Series dataLineChart = new XYChart.Series();
  public static void updateDataChart(){
      dataLineChart.getData().addAll(
                  myObservableList
              );
  }
  </code></pre>
  
  <p>Can someone help me with this problem ?</p>