From the course: Data Science for Java Developers

Unlock this course with a free trial

Join today to access over 22,500 courses taught by industry experts.

Calculating average MPG

Calculating average MPG

- [Instructor] Okay, so we've seen how to display data on a scatterplot. And the next thing we're going to do is take a look at a slightly different way to display data. There's obviously a lot of different charts, a lot of different graphs that we can use to visualize our data. So let's take a look at how to display bar charts in Java FX. So let's go over here and create a new Java FX application. And we're going to call this one bar graph. All right, and it's going to look just like what our scatterplot application looked like before. So for this one, what we're going to do is we're basically going to load all of the car data again. So basically what I'm going to do is just go in and copy and paste that from our scatterplot application. Just copy those two statements there. Paste it, and what we're going to do, why don't we just see how the average miles per gallon compares between cars with four cylinder engines, six…

Contents