From the course: Data Science for Java Developers
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Solution: Displaying data on a bar chart - Java Tutorial
From the course: Data Science for Java Developers
Solution: Displaying data on a bar chart
(upbeat music) - [Speaker] Okay, so I'm going to show you how I went about solving this challenge. The first thing I did, since we already had a lot of the logic completed for setting up the charts, is I went over to bar graph dot Java and copied and pasted a lot of the code from the start method here into the start method of our challenge class. And the next thing I did is, since the code that we copied and pasted had four-cylinder cars, six-cylinder cars, and eight-cylinder cars, and we have to change that to American cars, European cars, and Asian cars, I changed those in the following way. So I said, list American cars. And then, instead of filtering cars by their number of cylinders, I filtered cars by their origin. Now, it was at this point that I realized that our car record class doesn't yet parse the origin from the data. So the first thing I did was go to the car record data class and add an origin member…
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.
Contents
-
-
-
-
-
-
-
(Locked)
Setting up JavaFX5m 38s
-
(Locked)
Formatting data for a scatterplot7m 55s
-
(Locked)
Displaying a scatterplot5m 22s
-
(Locked)
Multiple datasets on a scatterplot6m 35s
-
(Locked)
Calculating average MPG4m 46s
-
(Locked)
Displaying a bar chart4m 17s
-
(Locked)
Challenge: Displaying data on a bar chart1m 15s
-
(Locked)
Solution: Displaying data on a bar chart4m 8s
-
(Locked)
-
-
-