You may see on the attached movie.
You may use this application:
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.*;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class JavaCharts extends Application {
public static void main(String[] args) {
launch(args);
}
PieChart testedPieChart = new PieChart();
VBox vb = new VBox();
@Override
public void start(Stage stage) throws Exception {
ObservableList<PieChart.Data> data = FXCollections.<PieChart.Data>observableArrayList();
for (int i = 0; i < 10; i++) {
data.add(new PieChart.Data("Data item " + i, i * 100));
}
testedPieChart.setData(data);
testedPieChart.setTitle("PieChart");
testedPieChart.setStyle("-fx-border-color: darkgray;");
testedPieChart.setPrefSize(600, 600);
Pane pane = new Pane();
pane.getChildren().add(testedPieChart);
vb.getChildren().addAll(pane);
Slider slider = new Slider();
slider.setMin(-1000);
slider.setMax(1000);
slider.setShowTickLabels(true);
slider.setShowTickMarks(true);
testedPieChart.labelLineLengthProperty().bindBidirectional(slider.valueProperty());
vb.getChildren().add(slider);
pane.setPrefSize(600, 600);
Scene scene = new Scene(vb, 700, 700);
stage.setScene(scene);
stage.show();
}
}
You can move slider's knob to reproduce issue.
You may use this application:
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.*;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class JavaCharts extends Application {
public static void main(String[] args) {
launch(args);
}
PieChart testedPieChart = new PieChart();
VBox vb = new VBox();
@Override
public void start(Stage stage) throws Exception {
ObservableList<PieChart.Data> data = FXCollections.<PieChart.Data>observableArrayList();
for (int i = 0; i < 10; i++) {
data.add(new PieChart.Data("Data item " + i, i * 100));
}
testedPieChart.setData(data);
testedPieChart.setTitle("PieChart");
testedPieChart.setStyle("-fx-border-color: darkgray;");
testedPieChart.setPrefSize(600, 600);
Pane pane = new Pane();
pane.getChildren().add(testedPieChart);
vb.getChildren().addAll(pane);
Slider slider = new Slider();
slider.setMin(-1000);
slider.setMax(1000);
slider.setShowTickLabels(true);
slider.setShowTickMarks(true);
testedPieChart.labelLineLengthProperty().bindBidirectional(slider.valueProperty());
vb.getChildren().add(slider);
pane.setPrefSize(600, 600);
Scene scene = new Scene(vb, 700, 700);
stage.setScene(scene);
stage.show();
}
}
You can move slider's knob to reproduce issue.