title: JavaFX I want to save Chart-Image completely
body: <p>This is my code:                                             </p>
  
  <pre><code>public class SceneToImageAndWrite extends Application {
  
      public static void main(String[] args) {
          launch(args);
      }
  
      @Override
      public void start(Stage stage) throws Exception {
          stage.setTitle("Primary Stage");
  
          final CategoryAxis xAxis = new CategoryAxis();
          xAxis.setLabel("Animals");
          final NumberAxis yAxis = new NumberAxis();
          yAxis.setLabel("Number");
  
          final LineChart&lt;String, Number&gt; lineChart = new LineChart&lt;String, Number&gt;(xAxis, yAxis);
          lineChart.setTitle("Line Chart");
  
          XYChart.Series&lt;String, Number&gt; series1 = new Series&lt;String, Number&gt;();
          series1.setName("Series");
  
          /** xAxis &amp; yAxis Data */
          LinkedHashMap&lt;String, Number&gt; map = new LinkedHashMap&lt;&gt;();      
          map.put("dog", 12);
          map.put("cat", 3);
          map.put("bear", 8);
          map.put("tiger", 20);
  
          for (Entry&lt;String, Number&gt; entry : map.entrySet()) {
              series1.getData().add(new XYChart.Data&lt;String, Number&gt;(entry.getKey(), entry.getValue()));
          }
  
          lineChart.getData().add(series1);
  
          Scene scene = new Scene(lineChart);
          stage.setScene(scene);
          stage.show();
  
          WritableImage snapShot = scene.snapshot(null);
          ImageIO.write(SwingFXUtils.fromFXImage(snapShot, null), "png", new File("test.png"));
      }
  }
  </code></pre>
  
  <p>Frame is great but saved-image doesn't have all chart-data that it should have. 
  I want to save Chart-Image completely, what's wrong?  ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀    </p>