[英]Change background color of JavaFX Chart
I want to set the background color to some JavaFX charts ( LineChart
and BarChart
).我想为一些 JavaFX 图表(
LineChart
和BarChart
)设置背景颜色。
Tried this:试过这个:
chart.setStyle("-fx-background-color: #ffbd05");
and和
chart.setStyle("-fx-bar-fill: #ffbd05");
... but no effect. ……但没有效果。
In case is useful for somebody.万一对某人有用。 Think this may help:
认为这可能会有所帮助:
chart.lookup(".chart-plot-background").setStyle("-fx-background-color: transparent;");
More on chart styling: https://news.kynosarges.org/2017/05/14/javafx-chart-coloring/更多关于图表样式: https : //news.kynosarges.org/2017/05/14/javafx-chart-coloring/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.