Back to all posts

Bar Chart Racer App

5/6/2024
Dynamic Racing Bar Charts in Java
Bar Chart Race Example
Bar Chart Race Example

Project Overview

A Java library for creating animated bar chart races that visualize ranking changes over time. Perfect for data storytelling and dynamic presentations.

Features

  • ๐Ÿš€ Java-powered animations
  • ๐Ÿ–ฅ๏ธ Swing/AWT based rendering
  • ๐Ÿ“ˆ CSV/JSON data input support
  • ๐ŸŽจ Customizable colors and styles
  • โฑ๏ธ Frame-rate control for smooth animations

Installation

  1. Clone this repository:
    git clone https://github.com/Abdullahon2006/bar_chart_racer.git
    
  2. Import into your Java project (JDK 8+ required)

Usage

  1. Prepare your data in CSV or JSON format with time-series values
  2. Create a BarRaceConfig object to set up your animation
  3. Call BarRaceRenderer.startAnimation() with your configuration
Example configuration:
BarRaceConfig config = new BarRaceConfig() .setInputFile("data.csv") .setOutputFile("animation.gif") .setFps(30) .setDimensions(800, 600);

Data Format

Your data file should contain:
  • One column for time periods
  • Additional columns for each category's values Example CSV:
date,Product A,Product B,Product C
2020-01,150,200,90
2020-02,170,180,110

Customization

Control these visual elements:
  • Bar colors and spacing
  • Time display format
  • Value labels and fonts
  • Background styling
  • Animation speed

Building from Source

Requires Maven:
mvn clean package

Contributing

Pull requests are welcome! Please:
  1. Fork the repository
  2. Create a feature branch
  3. Submit your changes

License

MIT License - see LICENSE file