I am trying in this code to style dynamically my AreaChart
series but it's not working. I want to change each series background without passing by CSS.
XYChart.Series series1 = new XYChart.Series();
series1.getNode().setStyle("chart-series-area-fill { -fx-fill: transparent; }");
Solution
Use the following code after you have shown the chart on a stage:
Why your approach does not work
You can't apply a css selector in a setStyle call, according to the javadoc: