JavaFx Scene Designer Select the chart axis type of chart

I am trying to create a histogram where the x axis is the Number axis and the y axis is the category axis. Thus, the bars will start on the y axis and go right. However, it seems that Scene Builder will be by default only so that the Number axis is the y axis and the category axis is the x axis.

Does anyone know a workaround to achieve what I'm trying to achieve? Or am I missing some features in Scene Builder?

Thanks!

+4
source share
1 answer

I have the same problem. It is not possible to change the axis from the graphical interface. If you open the fxml file, you can manually change them:

 <BarChart fx:id="chart" focusTraversable="false" horizontalGridLinesVisible="true" horizontalZeroLineVisible="true" legendVisible="false" mouseTransparent="false" prefHeight="385.9999000000025" prefWidth="599.9998779296875" verticalGridLinesVisible="false" verticalZeroLineVisible="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
  <yAxis>
    <CategoryAxis side="LEFT" />
  </yAxis>
  <xAxis>
    <NumberAxis side="BOTTOM" />
  </xAxis>
</BarChart>

( ).

+4

Source: https://habr.com/ru/post/1525907/


All Articles