Skip to content

OmriNaor/Natality-Graphs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Java Project: Natality-Graphs

Introduction

This project is an application that reads natality data from a CSV file and displays it using two different types of graphs (pie chart and column chart). The purpose of this project is to visualize natality data and perform various calculations for better understanding and analysis.

About

Reads natality data from a CSV file and display it, along with different calculations, using two different types of graphs.

Prerequisites

  • Java Development Kit (JDK) version 8 or later

Usage

  1. Clone "NatalityMini.csv"
  2. Locate the CSV file inside the Java files package

Structure

  • Main - Main function definition. Creates the frame and its defaults (using Java swing).
  • Chart - An abstract class to define a chart instance variables and functions.
  • Column - Extends the abstract chart class. Implementation of a column graph type including drawing.
  • Pie - Extends the abstract chart class. Implementation of a pie graph type including drawing.
  • NatalityPanel - Extends JPanel and implements MouseListener. Reads the details from the CSV file and gets input from the user. Displays the graphs accordingly.

The Algorithm

The program reads data from a CSV file using Java's File and BufferedReader. The program then proceeds to process the data and make different calculations.

Finally, creates a dynamic JPanel and two different types of graphs and displays one of them, according to the user's input.

The algorithm supports and displays extra data that the user can add by using the JButtons.

Getting Started

To compile and run the project, follow these steps:

  1. Clone the repository or download the source code.
  2. Import the project into your favorite Java IDE (e.g., Eclipse, IntelliJ IDEA).
  3. Ensure the required libraries and dependencies are properly set up.
  4. Compile and run the project from your IDE.

Examples

  • Pie chart:

image

  • Column chart:

image

About

Reads natality details from a file and displays in two different charts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages