Export Image
Export Code

Car Accidents by passenger type in Greece 2022

Nikos Pnevmatikos

Last edited May 29, 2024
Created on May 27, 2024

Visualization of Car Crash Data by Passenger Categories

This project visualizes car crash data categorized by different passenger configurations. The data includes the total number of accidents, as well as the breakdown into lethal and non-lethal accidents.

Data Format The data should be provided in a CSV file named CarCrashByPassengers.csv with the following format:

accidents by passenger categories, sum of accidents, lethal, non-lethal
only drivers, x, x, x
only passengers, x, x, x
only pedestrians, x, x, x
pedestrians and passengers, x, x, x
drivers and passengers, x, x, x
drivers and pedestrians, x, x, x
drivers, pedestrians, passengers, x, x, x

CSV file is a modified csv file from https://www.statistics.gr/el/statistics/-/publication/SDT04/2022

Project Structure

index.html: Contains the structure of the webpage, including the SVG element where the visualization will be rendered and the legend for the color-coded bars.
script.js: Contains the D3.js code to generate the bar chart visualization.

Grouped Bar Chart:

The bar chart displays bars grouped by the type of passenger category. Each group contains three bars representing the sum of accidents, lethal accidents, and non-lethal accidents.

Color Coding:

Sum of Accidents: Cyan (#48d1cc)
Lethal Accidents: Crimson (crimson)
Non-Lethal Accidents: Purple (#9370db)

Axes:

The x-axis displays the passenger categories.
The y-axis shows the number of accidents.

MIT Licensed