O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

A scatter chart works in a similar way to how a bar chart or a line chart works. It's another two-axis graph, where the data points are plotted on the two axes. The axes are created using javafx.scene.chart.CategoryAxis or javafx.scene.chart.NumberAxis, depending on whether the data is string or numeric. 

The data to be plotted is provided in the form of XYChart.Series<X,Y>, where X and Y can be String or any type extending Number, and it contains the data in the form of a list of XYChart.Data objects, something like the following:

XYChart.Series<Number,Number> series  = new XYChart.Series<>();
series.getData().add(new XYChart.Data<Number, Number>(xValue, yValue));

In a scatter chart, the data is plotted in the form of points, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required