简体   繁体   中英

JavaFX - XYChart with Axis Hidden

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?

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

for (Node n: chart.lookupAll(".axis")) {
  n.setVisible(false);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM