Write a class called NatalityPanel that will be inherited from
JPanel and will represent a graphical application that will allow
you to view various graphs from file data. in this website
(https://mega.nz/file/TwAGWJ5C#W6IyIQJTw ... i5mUvLUdEA)
you will find the file NatalityMini.csv. The file contains
information on approximately 37,000 births in the United States in
2020. Each birth is represented by a row that contains the year of
birth, month of birth (in integers between 1 and 12) and the sex of
the baby (M or F). The fields are separated by commas.
The graphical interface will consist of a Clear button, a Show
Chart button and a scroll box (JComboBox).
The scroll box will have two options - baby sex distribution and
month breakdown.
Selecting the baby sex option and clicking on show data will
display on the panel a pie chart that shows the amount of males
compared to the females in the births in the file.
Selecting the months option and clicking on show data will display
a stick chart that will show the number of births each month.
Clicking the clear button will clear the current chart from the
screen.
Remarks
1. Each time you draw a chart, the previous drawing should be
deleted.
2. It can be assumed that the size of the list of values and the
size of the list of labels are the same.
3. It can be assumed that the file is built in the structure
described in the exercise.
https://mega.nz/file/TwAGWJ5C#W6IyIQJTw ... i5mUvLUdEA
Write a class called NatalityPanel that will be inherited from JPanel and will represent a graphical application that wi
-
- Posts: 43759
- Joined: Sat Aug 07, 2021 7:38 am