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

[CategoryAxis] perpendicular label rotation is used too late when labels already have some rotation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 9
    • javafx

      The following sample has x category axis where all the labels won't fit, but it doesn't rotate the labels accordingly. It has to be resized to ~300 for that to happen.


          @Override
          public void start(Stage stage) {
              stage.setTitle("Scatter Chart Sample");
              final CategoryAxis xAxis = new CategoryAxis();
              final NumberAxis yAxis = new NumberAxis();
              final ScatterChart<String, Number> sc
                      = new ScatterChart<String, Number>(xAxis, yAxis);
              xAxis.setLabel("Age (years)");
              yAxis.setLabel("Returns to date");

              sc.setTitle("Investment Overview");

              XYChart.Series series1 = new XYChart.Series();

              series1.setName("Option 1");
              series1.getData().add(new XYChart.Data("four", 193.2));
              series1.getData().add(new XYChart.Data("two", 33.6));
              series1.getData().add(new XYChart.Data("six", 24.8));
              series1.getData().add(new XYChart.Data("one", 14));
              series1.getData().add(new XYChart.Data("one", 26.4));
              series1.getData().add(new XYChart.Data("four", 114.4));
              series1.getData().add(new XYChart.Data("eight", 323));
              series1.getData().add(new XYChart.Data("three", 193.2));
              series1.getData().add(new XYChart.Data("ten", 33.6));
              series1.getData().add(new XYChart.Data("five", 24.8));
              series1.getData().add(new XYChart.Data("seven", 14));
              series1.getData().add(new XYChart.Data("twelve", 26.4));
              series1.getData().add(new XYChart.Data("eighteen", 114.4));
              series1.getData().add(new XYChart.Data("zero", 323));
              sc.setPrefSize(330, 400);
              sc.getData().addAll(series1);
              Scene scene = new Scene(new VBox());
              final VBox vbox = new VBox();
              final HBox hbox = new HBox();

              vbox.getChildren().addAll(sc, hbox);
              hbox.setPadding(new Insets(10, 10, 10, 50));

              sc.getXAxis().setTickLabelRotation(180);

              ((VBox) scene.getRoot()).getChildren().add(vbox);
              stage.setScene(scene);
              stage.show();
          }

            Unassigned Unassigned
            msladecek Martin Sládeček
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported: