I have a window that has three different line charts in it. I am trying to set the color of each line chart series individually. Right now I have a css file that has something l
To reference nodes individually (instead of grouped by class) in a CSS file, you need to add an id
to the node:
LineChart<Number, Number> chart1 = ... ;
LineChart<Number, Number> chart2 = ... ;
LineChart<Number, Number> chart3 = ... ;
chart1.setId("chart1");
chart2.setId("chart2");
chart3.setId("chart3");
Obviously, you can choose more meaningful ids that describe what each chart is.
Then in your CSS you can do
#chart1 .chart-series-line { -fx-stroke: blue }
#chart2 .chart-series-line { -fx-stroke: black }
#chart3 .chart-series-line { -fx-stroke: green }