The style is applied through the css-file, for example:

.chart-series-line{ -fx-stroke-width: 2; } 

And how to do the same thing through the setStyle () method in the code itself?

    1 answer 1

    Like this:

     for ( Node n : chart.lookupAll( ".chart-series-line" ) ) { n.setStyle("-fx-stroke-width: 2" ); }