我想将背景色设置为某些JavaFX图表(LineChart
和BarChart
)。
尝试过此:
chart.setStyle("-fx-background-color: #ffbd05");
和
chart.setStyle("-fx-bar-fill: #ffbd05");
...但是没有效果。
如果对某人有用。认为这可能有所帮助:
chart.lookup(“。chart-plot-background”)。setStyle(“-fx-background-color:transparent;”);
有关图表样式的更多信息:https://news.kynosarges.org/2017/05/14/javafx-chart-coloring/