title: how to display data dynamically in jfreechart
body: <p>I have created a function that processes some value.
  Now, my problem is that the graph i create displays the values generated after ALL the values have been calculated. i want to generate the graph such that the as and when the data is calculated; it must be plotted on the data.
  The calculation and the display of data in the graph must appear parallel.
  I have generated the graph as:</p>
  
  <pre><code> dataset.addSeries(series1); 
   dataset = new XYSeriesCollection();
  
   series1 = new XYSeries("% ERROR");
   chart = ChartFactory.createXYLineChart("Percent Error", "Number of Records", "% Error", dataset,PlotOrientation.VERTICAL,true, true, true);
   chart.setBackgroundPaint(Color.WHITE);
   frame = new ChartFrame("Error graph", chart);
   frame.pack();
   frame.setVisible(true);
  </code></pre>
  
  <p>The series1 is plotted on the graph.the values in series1 is added on every iteration of the loop which generates some value.
  Can it be done using wait and notify? I am not really sure about this functions. Please help</p>