Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Olympic Gold Medals by Sports

Public visualization

Viewing a saved revision (read-only)

7d1fa2c552694c09927be951bd1db952

Olympic Gold Medals by Sports

0 stars0🌍 Public
Yyaredmtaye@gmail.com
Last edited Sep 24, 2024
Created on Sep 24, 2024

This bar chart visualizes Olympic gold medal counts across eight sports, showing swimming and javelin with the highest totals while running and cycling have the least. The visualization uses D3.js version 7.8.5, rendering SVG rect elements via a dynamic bar chart that adapts to container dimensions. SVG is selected with `d3.select`, while axes are generated using `scaleBand` for the categorical sports on the x-axis and `scaleLinear` for medal counts on the y-axis. The code implements `axisBottom` and `axisLeft` for scalable gridlines and labels.

AI-generated description

Bar Chart with D3.js This project demonstrates how to create a basic Bar Chart using D3.js. The visualization is rendered with SVG elements, where each bar represents data points, such as the number of medals in different sports. This guide will help you understand how to work with SVGs in D3.js, scale the data, and add axis labels to make a clear and informative bar chart.

Features: Dynamic Bar Chart: The bar chart adjusts its size based on the container dimensions. SVG Elements: Each bar is drawn using rect elements in an SVG. Scalable Axes: X and Y axes are generated dynamically using scaleBand and scaleLinear respectively. Responsive Lab