title: JavaFX LineChart - draw array
body: <p>I'm trying to display data to a user with a <code>LineChart</code> in JavaFX.  I have an array of Float (not the primitive, the object, as in <code>Float[]</code>) that is ready to be added that could be anywhere from 512 to 4096 points long.</p>
  
  <p>All the examples and help for <code>LineChart</code> show that data has to be added point by point using <code>XYChart.Series.getData().add(new XYChart.Data(X, Y))</code> where X would be the index and Y would be the value at Float[index].  This is really, really slow since this approach requires looping through the array, but it works.  I'd like the <code>LineChart</code> to update at 30FPS but it as less than 1FPS right now :/</p>
  
  <p>Is there a faster way where I can just toss an array at the JavaFX <code>LineChart</code> class and have it draw without looping through and adding each point?</p>
  
  <p><strong>EDIT (Solution Found)</strong>:</p>
  
  <p>srm, that concept works!</p>
  
  <p>On the first run, just fill the <code>XYChart.Series</code> with <code>new XYChart.Data(X,Y)</code>.  Then loop through and fetch and update using <code>XYChart.Series.get(index).setYData(NewValue)</code></p>