Creating index charts
An index chart is a line chart that shows the percentage change of something over time. Frequently, such a chart is based on a single data attribute. In the following example, we will be using the Belgian population for six decades. The data is a subset of population data found at https://ourworldindata.org/grapher/population-by-country?tab=data:
Decade |
Population |
1950 |
8639369 |
1960 |
9118700 |
1970 |
9637800 |
1980 |
9846800 |
1990 |
9969310 |
2000 |
10263618 |
We start by creating the MainApp
class, which extends Application
. We create a series of instance variables. The XYChart.Series
class represents a series of data points for some plot. In our case, this will be for the decades and population, which we will initialize shortly. ...
Get Java for Data Science now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.