Skip to content

A foundational Java project demonstrating CSV parsing and bar chart visualization with JFreeChart, built as part of introductory data analysis coursework.

Notifications You must be signed in to change notification settings

enegonza/java-bar-chart-basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Java Bar Chart Basic Java JFreeChart Status

A foundational Java project demonstrating CSV parsing and bar chart visualization with JFreeChart, built as part of introductory data analysis coursework.

๐Ÿ“Š Bar Chart Output Below is the bar chart generated using JFreeChart based on values parsed from a CSV file:

Bar Chart Screenshot

๐Ÿ› ๏ธ Project Overview

This project reads a CSV file containing traffic volume data, extracts relevant values, and visualizes them using a bar chart. It represents an early-stage exercise in Java programming, data parsing, and basic visualization.

The primary goals were:

Learning how to read and process structured data files Understanding how external libraries (like JFreeChart) integrate into Java projects Building the foundation for more advanced object-oriented visualization projects

๐Ÿ” Features

Reads data from an external CSV file Parses thousands of rows of traffic count data Handles invalid or malformed entries gracefully Uses DefaultCategoryDataset to structure numerical values Renders a bar chart using JFreeChart Displays the chart in a simple Swing UI window

๐Ÿง  Skills Demonstrated

Java fundamentals: packages, imports, class structure, main entry point File I/O: BufferedReader, Files.newBufferedReader, and path handling Data parsing & cleaning: splitting CSV rows, numeric conversion, skipping invalid lines Visualization: building bar charts using JFreeChartโ€™s API Dataset preparation: populating chart datasets for rendering Error handling: resilient operations using try/catch blocks Version control: organizing and structuring a clean GitHub repository

๐Ÿ“ Project Structure java-bar-chart-basic/ โ”‚ โ”œโ”€โ”€ src/ โ”‚ โ””โ”€โ”€ unit8/ โ”‚ โ””โ”€โ”€ unit8assignment1.java โ”‚ โ”œโ”€โ”€ screenshots/ โ”‚ โ””โ”€โ”€ bar_chart.png (optional but recommended) โ”‚ โ”œโ”€โ”€ README.md โ””โ”€โ”€ .gitignore (optional)

โ–ถ๏ธ How to Run

Install Java (JDK 17+ recommended) Add the JFreeChart JAR to your project classpath Open the project in Eclipse, IntelliJ, or your preferred IDE Ensure the CSV file path in main() points to your local copy Compile and run: javac unit8assignment1.java java unit8assignment1 The bar chart window will appear once the data loads.

๐Ÿ“ฆ Technologies Used

Java SE 17+ JFreeChart 1.5.6 Swing (for chart window display) CSV Text Data

๐Ÿ“š Course Context This project was created for IN300 โ€“ Programming for Data Analysis to introduce working with large datasets evaluating data programmatically producing introductory visualizations It serves as the foundation for a more advanced, refactored, object-oriented version of the project.

๐Ÿ”ฎ Next Steps (Advanced Version) The enhanced version will include: Modular design (DatasetLoader, ChartBuilder, etc.) Cleaner separation of concerns Reusable visualization components Additional chart types (scatter plots, line charts) Optional GUI improvements

A separate repository will be created to showcase the improved architecture.

About

A foundational Java project demonstrating CSV parsing and bar chart visualization with JFreeChart, built as part of introductory data analysis coursework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages