Skip to main content
100%

Fork of Making A Bar Chart

✓ Published0🌍 Public
AAlex Quan
Last edited May 12, 2023
Created on May 12, 2023
Forked from Making A Bar Chart

This example shows a horizontal bar chart of the ten most populous countries using population data from a local CSV file. The visualization renders as an SVG, with each country represented by a steel-blue bar sorted by default in data order (China through Mexico). The code imports D3 v7 modules including `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to load the data, map population values to pixel widths, position country labels on the y-axis, and display numeric population on the x-axis. The chart applies margins and appends axes and rectangles to a single `<g>` group element.

AI-generated description
MIT Licensed

Similar vizzes