Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8096604

[PieChart] label's line length can confuse slider, when values are big.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P4
    • 8u20
    • 7u6
    • javafx
    • 2.2.0b15

    Description

      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.

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            akirov Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: