Question

I am trying to create a bar chart where the x-axis is a Number axis, and the y-axis is a Category axis. This way the bars will be starting on the y-axis and extend to the right. However, it seems as though Scene Builder will only default to allowing the Number axis be the y-axis, and the Category axis to be the x-axis.

Does anyone know a work-around to achieve what I am trying to accomplish? Or am I missing some functionality options in Scene Builder?

Thanks!

Était-ce utile?

La solution

I've the same problem. From the GUI isn't possible to change axis tipe. If you open the fxml 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>

This example revert category with number axis (what i need).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top