JavaFX - XYChart with Axis Hidden

2019-08-28 00:26发布

Is it possible to make an XYChart that has its axis hidden? Ideally removed.

From looking at source it seems that it must have one due to the limitation that XYChart does not check for null Axis when layoutChartChildren() is called, which is a shame since XYChart provides for multiple data series and the addition of data in a series.

IMO a separation of concern from the Axis.

Any thoughts on a solution?

标签: java javafx-2
1条回答
一纸荒年 Trace。
2楼-- · 2019-08-28 00:50

After you have shown a stage displaying the chart, call:

for (Node n: chart.lookupAll(".axis")) {
  n.setVisible(false);
}
查看更多
登录 后发表回答