Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将如何使条形图可滚动?我一直在尝试使用带有条形图窗格的滚动窗格。
到目前为止,这就是我所拥有的:
final BarChart chartPane = chart.getGraph(); chartScrollPane.setContent(chartPane); chartScrollPane.setFitToWidth(true);
chartPane 为 1200px 宽,chartScrollPane 为 800px。
只需将 BarChart 的宽度设置为更大的值。当图表嵌入到 ScrollPane 中时,它将关心滚动条。
例如:
ScrollPane scrollPane = new ScrollPane(); Scene scene = new Scene(scrollPane, 800, 600); chartPane.setPrefWidth(20000); chartPane.setMinWidth(20000); scrollPane.setContent(chartPane);