8
  • ラベルを 270 回転させようとすると問題が発生しlabel.setRotate(270)ます。
  • しかし、ラベルのテキストは消えます。

ラベルのテキストが消える

  • それがコードサンプルです。

    LineChart chart = new LineChart(new CategoryAxis(), new NumberAxis());
    chart.setLegendVisible(false); 
    
    /**
     * Grid pane which contain the charts and vertical label to indicate for the row title
     */
    GridPane root = new GridPane();
    root.add(chart, 0, 0);
    
    /**
     * Want to add vertical label to refer to the row title.
     */
    Label label = new Label("Row Title");
    label.setRotate(270);
    // label.setMinWidth(200); 
    
    root.add(label, 1, 0);
    

アップデート

  • setMinWidth(200)別の問題を表示 しようとすると。ラベルは回転後も幅のスペースを取ります
4

2 に答える 2