Reputation: 419
I want to use 2 objects with one line on each.
I set color like this .chart-series-line {-fx-stroke: #ff0099; }
and lines changed both. But color on the lines must be different. How can i changed lines separately?
Upvotes: 1
Views: 166
Reputation: 209330
Just set a CSS id on each line chart, e.g.
LineChart leftChart = new LineChart(...);
leftChart.setId("left");
LineChart rightChart = new LineChart(...);
rightChart.setId("right");
(or if you are using FXML
<LineChart id="left" ... >
etc)
and then in your css file you can do
#left .chart-series-line {-fx-stroke: #ff0099; }
etc.
Upvotes: 1