From the course: Learning JavaFX GUI Development
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Add charts for better visualization
From the course: Learning JavaFX GUI Development
Add charts for better visualization
- [Voiceover] Another great visualization technique is to use a chart. JavaFX supports eight different types of charts. The Javafx.scene.chart API lists each of the eight different types of charts. Some of the commonly used charts are a LineChart, a BarChart, a PieChart, and a ScatterChart. Each of these charts comes with some default configurations that make creating charts easy. Let's try a PieChart to show where our money goes each month. Let's do a monthly budget. In NetBeans I'm going to create a new application, File, New Project, Next, and I'm gonna call it monthly budget. I'm gonna scroll down a little bit, and delete the template code. In order to create the chart, I need to have a list of data that will be displayed in my chart. So we're gonna use the observable list. The type of data that I'm gonna use is PieChart. And I'm just gonna call it pieData. I'm gonna use the FXCollections .observableArrayList, and now I'm going to define the different values that I want to include…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.