-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
7u6
-
2.2.0b18
You can see on the attached movie, that legend now disappears, but in b17 in didn't disappear at some value of height.
Code to reproduce:
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.chart.PieChart;
import javafx.scene.control.Slider;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class JavaApplication50 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
ObservableList<PieChart.Data> data;
data = FXCollections.<PieChart.Data>observableArrayList();
for (int i = 0; i < 10; i++) {
data.add(new PieChart.Data("Data item " + i, i * 100));
}
PieChart chart = new PieChart(data);
chart.setTitle("PieChart");
chart.setStyle("-fx-border-color: darkgray;");
chart.setPrefSize(300, 300);
Pane pane = new Pane();
pane.getChildren().add(chart);
pane.setPrefSize(300, 300);
VBox vb = new VBox();
vb.getChildren().add(pane);
Slider slider1 = new Slider(0, 400, 300);
slider1.setShowTickLabels(true);
slider1.setShowTickMarks(true);
slider1.valueProperty().bindBidirectional(chart.prefWidthProperty());
vb.getChildren().add(slider1);
Slider slider2 = new Slider(0, 400, 300);
slider2.setShowTickLabels(true);
slider2.setShowTickMarks(true);
slider2.valueProperty().bindBidirectional(chart.prefHeightProperty());
vb.getChildren().add(slider2);
vb.setPrefSize(300, 600);
Scene scene = new Scene(vb, 700, 700);
stage.setScene(scene);
stage.show();
}
}
Code to reproduce:
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.chart.PieChart;
import javafx.scene.control.Slider;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class JavaApplication50 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
ObservableList<PieChart.Data> data;
data = FXCollections.<PieChart.Data>observableArrayList();
for (int i = 0; i < 10; i++) {
data.add(new PieChart.Data("Data item " + i, i * 100));
}
PieChart chart = new PieChart(data);
chart.setTitle("PieChart");
chart.setStyle("-fx-border-color: darkgray;");
chart.setPrefSize(300, 300);
Pane pane = new Pane();
pane.getChildren().add(chart);
pane.setPrefSize(300, 300);
VBox vb = new VBox();
vb.getChildren().add(pane);
Slider slider1 = new Slider(0, 400, 300);
slider1.setShowTickLabels(true);
slider1.setShowTickMarks(true);
slider1.valueProperty().bindBidirectional(chart.prefWidthProperty());
vb.getChildren().add(slider1);
Slider slider2 = new Slider(0, 400, 300);
slider2.setShowTickLabels(true);
slider2.setShowTickMarks(true);
slider2.valueProperty().bindBidirectional(chart.prefHeightProperty());
vb.getChildren().add(slider2);
vb.setPrefSize(300, 600);
Scene scene = new Scene(vb, 700, 700);
stage.setScene(scene);
stage.show();
}
}