title: Disappearance of the series to the window resizing (JavaFX)
body: <p>I have a problem with JavaFX; I explain: I have a class with 5 series to be plotted but 4 are of scatterchart (points) and a Linechart 1 (solid line). The line chart has continued lower parameters on the X and Y axis higher than the other four series and therefore I need to do a little more calculation. I insert the code of the controller class that draws the graph:</p>
  
  <pre><code>    public class ControllerFormantsSmooth {
  
          public static void plotFormantSmooth(String path, Stage stage, String name) {
              final NumberAxis xAxis = new NumberAxis(); //asseX
              final NumberAxis yAxis = new NumberAxis(); //asseY
              //POINT GRAPH
              final ScatterChart&lt;Number, Number&gt; scatterFormant = new ScatterChart&lt;Number, Number&gt;(xAxis, yAxis);
  
              //SOLID LINE GRAPH
              final LineChart&lt;Number, Number&gt; lineChartFull = new LineChart&lt;Number, Number&gt;(xAxis, yAxis);
  
              ArrayList&lt;Double&gt; extractedF1;
              ArrayList&lt;Double&gt; extractedF2;
              ArrayList&lt;Double&gt; extractedF3;
              ArrayList&lt;Double&gt; extractedF4;
  
              ArrayList&lt;Double&gt; extractedTimeF1;
  
              ArrayList&lt;Double&gt; extractedData; 
              ArrayList&lt;Double&gt; extractedTime;
  
              //Gestione e settaggio del grafico
              scatterFormant.getData().clear();
              scatterFormant.setOpacity(0.8);
              scatterFormant.getStyleClass().add("CSSformant");
              scatterFormant.setAnimated(true);
              scatterFormant.autosize();
              xAxis.setLabel("Time(ms)");
              yAxis.setLabel("Formant(Hz)");
  
              //Gestione e settaggio del grafico
                      lineChartFull.getData().clear();
                      lineChartFull.setOpacity(0.8);
                      lineChartFull.setCreateSymbols(false);
  
  
              try {
  
                  //POPULATE LIST
                  extractedF1 = FormantExtractor.pointF1();
                  extractedF2 = FormantExtractor.pointF2();
                  extractedF3 = FormantExtractor.pointF3();
                  extractedF4 = FormantExtractor.pointF4();
  
                  extractedTimeF1 = FormantExtractor.timeF1();
  
                  AudioWaveformCreator.waveForm(path);
                  extractedData = AudioWaveformCreator.audioPoints();
                  extractedTime = AudioWaveformCreator.pointTimeOscillo();
  
  //POINT SERIES
                  XYChart.Series&lt;Number, Number&gt; seriesF1 = new XYChart.Series&lt;Number, Number&gt;();
                  XYChart.Series&lt;Number, Number&gt; seriesF2 = new XYChart.Series&lt;Number, Number&gt;();
                  XYChart.Series&lt;Number, Number&gt; seriesF3 = new XYChart.Series&lt;Number, Number&gt;();
                  XYChart.Series&lt;Number, Number&gt; seriesF4 = new XYChart.Series&lt;Number, Number&gt;();
  
  //LINE SERIE
                  XYChart.Series&lt;Number, Number&gt; series = new XYChart.Series&lt;Number, Number&gt;();
                  /*
                   * A ogni serie viene aggiunta una formante
                   */
                  for (int i = 0; i &lt; extractedF1.size()-1; i++) {
                      if(extractedF1.get(i)+1&gt;extractedF1.get(i+1) &amp;&amp; extractedF1.get(i+1)+1&gt;extractedF1.get(i) &amp;&amp;
                              extractedF1.get(i)&lt;FormantExtractor.getF1_avg()+50 &amp;&amp; extractedF1.get(i)&gt;FormantExtractor.getF1_avg()-50){
                          seriesF1.getData().add(new XYChart.Data&lt;Number, Number&gt;(extractedTimeF1.get(i), extractedF1.get(i)));           
                      }
                  }
                  for (int i = 0; i &lt; extractedF2.size()-1; i++) {
                      if(extractedF2.get(i)+10&gt;extractedF2.get(i+1) &amp;&amp; extractedF2.get(i+1)+10&gt;extractedF2.get(i) &amp;&amp; 
                              extractedF2.get(i)&lt;FormantExtractor.getF2_avg()+50 &amp;&amp; extractedF2.get(i)&gt;FormantExtractor.getF2_avg()-50){
                          seriesF2.getData().add(new XYChart.Data&lt;Number, Number&gt;(extractedTimeF2.get(i), extractedF2.get(i)));
                      }
                  }
                  for (int i = 0; i &lt; extractedF3.size()-1; i++) {
                      if(extractedF3.get(i)+10&gt;extractedF3.get(i+1) &amp;&amp; extractedF3.get(i+1)+10&gt;extractedF3.get(i) 
                              &amp;&amp; extractedF3.get(i)&lt;FormantExtractor.getF3_avg()+50 &amp;&amp; extractedF3.get(i)&gt;FormantExtractor.getF3_avg()-50){
                          seriesF3.getData().add(new XYChart.Data&lt;Number, Number&gt;(extractedTimeF3.get(i), extractedF3.get(i)));
                      }
                  }
                  for (int i = 0; i &lt; extractedF4.size()-1; i++) {
                      if(extractedF4.get(i)+10&gt;extractedF4.get(i+1) &amp;&amp; extractedF4.get(i+1)+10&gt;extractedF4.get(i) 
                              &amp;&amp; extractedF4.get(i)&lt;FormantExtractor.getF4_avg()+50 &amp;&amp; extractedF4.get(i)&gt;FormantExtractor.getF4_avg()-50){
                          seriesF4.getData().add(new XYChart.Data&lt;Number, Number&gt;(extractedTimeF4.get(i), extractedF4.get(i)));
                      }
                  }
  
  
  
                  for (int i = 0; i &lt; extractedData.size(); i= i+100) {
                      series.getData().add(new XYChart.Data&lt;Number, Number&gt;(extractedTime.get(i)*2550, (extractedData.get(i)/10)));
                  }
  
  
                  scatterFormant.getData().addAll(seriesF1,seriesF2,seriesF3,seriesF4);
                  lineChartFull.getData().add(series);
  
                  StackPane stackpane = new StackPane();
                  stackpane.getChildren().addAll(lineChartFull,scatterFormant);
  
                  //CREATE WINDOW
                  Scene scene = new Scene(stackpane, 1000, 600);
  
                  scatterFormant.getStylesheets().add("application/application.css");
                  stage.setScene(scene);
                  stage.show();
                  scatterFormant.setLegendVisible(false);
                  //lineChartFull.setLegendVisible(false);;
              } catch (java.lang.Exception e) {
                  e.printStackTrace();
              }
          }
      }
  </code></pre>
  
  <p>Then the window here is this:
  <a href="https://i.stack.imgur.com/muH2R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/muH2R.png" alt="Correct"></a>
  And it is correct (just what I want!)
  But if I resize the window (magnify) the result is this (graph disappears by a solid line):</p>
  
  <p><a href="https://i.stack.imgur.com/bTPI0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bTPI0.png" alt="Incorrect"></a>
  I just can not understand why ... you have ideas? Thanks in advance to those who want to help me.</p>