Making charts in JavaFX is easy:
- Create a list of data in a chart specific format
- Configure how you want your chart to look
Making charts in JavaFX is easy:
This chart shows only one dataset as the pie's slices. The bigger a corresponding value, the bigger its slice:
// chapter10/chart/PieChartDemo.java
ObservableList<PieChart.Data> pieChartData =
FXCollections.observableArrayList(
new PieChart.Data("Luck", 10),
new PieChart.Data("Skill", 30),
new PieChart.Data("Power of Will", 15),
new PieChart.Data("Pleasure", 5),
new PieChart.Data("Pain", 40));
The JavaFX PieChart for...