JavaFX - XYChart with Axis Hidden

故事扮演 提交于 2019-12-25 16:44:58

问题


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?


回答1:


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

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


来源:https://stackoverflow.com/questions/16910095/javafx-xychart-with-axis-hidden

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!