javajavafxlinechart

JavaFX Line Chart: Only display points for one of the XYChart.Series


I have a Line Chart with up to 3 XYChart.Series (graphs of mathematical functions), where I have set createSymbols == false.

And now I additionally need to display a series of points, but not display the connecting lines between them.

How can I accomplish this?

Best Regards

Edit: Part of the Code (Creating the plot and adding one XYChart.Series)

LineChart<Number, Number> plot = new LineChart<Number,Number>(xAxis,yAxis);
plot.setCreateSymbols(false);
XYChart.Series xychartlint = new XYChart.Series();
xychartlint.setName("Lagrange Interpolation");
plot.getData().add(xychartlint);
for(double i = minx; i < maxx; i = i + 0.01){
 xychartlint.getData().add(new XYChart.Data(i, lagrange.getY(i)));
}

Edit 2 Solution I found:

Using css to change the colors of series to transparent:

How to combine scatter chart with line chart to show line of regression? JavaFX


Solution

  • After a few hours I found an answer to my question.

    You can accomplish it, by using css to change the colors of the line of one series to transparent like shown here:

    How to combine scatter chart with line chart to show line of regression? JavaFX