title: updating graph on each iteration of a loop
body: <p>I have a bubble graph that I need to update the radius of each bubble on every iteration of a loop. Each iteration the loop analyses a tweet and updates the topic count and then each bubble is updated with this information.</p>
  
  <p>The problem I'm having is that the bubbles just grow once all the tweets have been analysed and not after each one.</p>
  
  <p>I need the graph to update after each iteration of the loop so you can see the analysis taking place.</p>
  
  <p>Here's the code I use to try and do this currently.</p>
  
  <pre><code> private void onLiveDemoButtonClicked(ActionEvent event) throws IOException, JWNLException {
      fFilePath = Paths.get("C:\\Users\\Lynsey\\Documents\\FinalYearProject\\words\\test.txt");
      Scanner scanner =  new Scanner(fFilePath, ENCODING.name());
  
      int tweetCount = 0;
      Tweets tweetDemo = new Tweets();
      while(scanner.hasNextLine()) {
     // if(tweetCount &lt;= 100) {
        tweetCount++;
       // System.out.println(scanner.nextLine());
        String currentTweet = scanner.nextLine();
        tweetDemo.processLineByLine(currentTweet);
  
        XYChart.Series&lt;Number, Number&gt; s = liveDemoBubbleChart.getData().get(0);
        s.getData().add(new XYChart.Data(5, 5, ProjectProperties.getInstance().getSportsTweetsCount()));
        XYChart.Series&lt;Number, Number&gt; p = liveDemoBubbleChart.getData().get(1);
        p.getData().add(new XYChart.Data(25, 25, ProjectProperties.getInstance().getPoliticsTweetsCount()));
        XYChart.Series&lt;Number, Number&gt; d = liveDemoBubbleChart.getData().get(2);
        d.getData().add(new XYChart.Data(55, 55, ProjectProperties.getInstance().getIllnessTweetsCount()));
        XYChart.Series&lt;Number, Number&gt; w = liveDemoBubbleChart.getData().get(3);
        w.getData().add(new XYChart.Data(75, 75, ProjectProperties.getInstance().getWarTweetsCount()));
        XYChart.Series&lt;Number, Number&gt; m = liveDemoBubbleChart.getData().get(4);
        m.getData().add(new XYChart.Data(95, 95, ProjectProperties.getInstance().getMoneyTweetsCount()));
        XYChart.Series&lt;Number, Number&gt; u = liveDemoBubbleChart.getData().get(5);
        u.getData().add(new XYChart.Data(115, 115, ProjectProperties.getInstance().getUndefinedTweetsCount()));
  
  
  
  
      }
  </code></pre>