【发布时间】:2014-02-08 05:43:52
【问题描述】:
我正在尝试创建一个条形图,其中 x 轴是数字轴,y 轴是类别轴。这样,条形图将从 y 轴开始并向右延伸。但是,Scene Builder 似乎只默认允许 Number 轴为 y 轴,Category 轴为 x 轴。
有人知道实现我想要完成的工作的变通方法吗?还是我错过了 Scene Builder 中的一些功能选项?
谢谢!
【问题讨论】:
标签: javafx bar-chart scenebuilder
我正在尝试创建一个条形图,其中 x 轴是数字轴,y 轴是类别轴。这样,条形图将从 y 轴开始并向右延伸。但是,Scene Builder 似乎只默认允许 Number 轴为 y 轴,Category 轴为 x 轴。
有人知道实现我想要完成的工作的变通方法吗?还是我错过了 Scene Builder 中的一些功能选项?
谢谢!
【问题讨论】:
标签: javafx bar-chart scenebuilder
我也有同样的问题。无法从 GUI 更改轴尖。 如果您打开 fxml,您可以手动更改它们:
<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>
此示例使用数字轴恢复类别(我需要)。
【讨论】: