0

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

Community
  • 1
  • 1
DarkShark
  • 11
  • 1
  • 4
  • I would help, but you need to provide some code, to allow help to correct it and not give hole code – azro Mar 13 '17 at 20:48
  • It's not really clear what you're asking. Do you just want the points, but no connecting lines? Isn't that just a `ScatterChart`, not a `LineChart`? – James_D Mar 13 '17 at 20:57
  • @azro: Added some of my code. – DarkShark Mar 13 '17 at 21:06
  • @james_d: the problem is that I need both in one chart, 3 series of points with connection (graps of functions), and 1 series of points without – DarkShark Mar 13 '17 at 21:08
  • There may be an easier way, but you can use the technique in http://stackoverflow.com/questions/38871202/how-to-add-shapes-on-javafx-linechart – James_D Mar 13 '17 at 21:11
  • Something else you can try: http://stackoverflow.com/questions/28788117/stacking-charts-in-javafx – SedJ601 Mar 14 '17 at 06:50

1 Answers1

0

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

Community
  • 1
  • 1
DarkShark
  • 11
  • 1
  • 4