Code: Select all
chartViewer.setPrefHeight(300);
You could also consider removing the VBox and second anchor pane, and add the ChartViewer directly to the first AnchorPane:
Code: Select all
tab.setContent(anchorPane);
// VBox vBox = new VBox();
// anchorPane.getChildren().add(vBox);
// AnchorPane.setBottomAnchor(vBox, 0.0);
// AnchorPane.setLeftAnchor(vBox, 0.0);
// AnchorPane.setRightAnchor(vBox, 0.0);
// AnchorPane.setTopAnchor(vBox, 0.0);
// vBox.setBackground(new Background(new BackgroundFill(Paint.valueOf("BLUE"), CornerRadii.EMPTY, Insets.EMPTY)));
// AnchorPane anchorPane1 = new AnchorPane();
// vBox.getChildren().add(anchorPane1);