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

[Axis] when new font is applied, tick labels are not rechecked

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8u20
    • 7u6
    • javafx
    • 2.2.0b15

      Look at the attached movie. I change font to bigger one. And after that I point on the axis. You can see, how neighbor labels started to intersect. I change upperbound a bit, and reevaluating happens. Some labels disappear. after that I change font back and font actually become smaller. some space for missed labels appear, but labels didn't appear. I have to change upperbound (actually, I need somehow make axis to redraw itself), and missed labels appeared again.

      Code:

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.chart.LineChart;
      import javafx.scene.chart.NumberAxis;
      import javafx.scene.control.ComboBox;
      import javafx.scene.control.Slider;
      import javafx.scene.layout.Pane;
      import javafx.scene.layout.VBox;
      import javafx.scene.text.Font;
      import javafx.stage.Stage;

      public class JavaCharts extends Application {

          public static void main(String[] args) {
              launch(args);
          }
          NumberAxis axis1 = new NumberAxis(0, 100, 10);
          NumberAxis axis2 = new NumberAxis(0, 100, 10);
          LineChart testedLineChart = new LineChart(axis1, axis2);
          VBox vb = new VBox();

          @Override
          public void start(Stage stage) throws Exception {
              testedLineChart.setTitle("LineChart");
              testedLineChart.setStyle("-fx-border-color: darkgray;");

              Pane pane = new Pane();
              pane.setPrefSize(600, 600);

              Slider slider = new Slider(0, 500, 10);
              slider.setShowTickLabels(true);
              slider.setShowTickMarks(true);
              slider.valueProperty().bindBidirectional(axis1.upperBoundProperty());

              ComboBox cb = new ComboBox();
              cb.getItems().addAll(new Font("Arial", 20), Font.getDefault());
              cb.valueProperty().bindBidirectional(axis1.tickLabelFontProperty());

              pane.setPrefSize(600, 600);
              pane.getChildren().add(testedLineChart);

              vb.getChildren().addAll(pane, slider, cb);

              Scene scene = new Scene(vb, 700, 700);
              stage.setScene(scene);
              stage.show();
          }
      }

            msladecek Martin Sládeček
            akirov Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: