Skip to main content
100%

Making a Bar chart

✓ Published0🌍 Public
AAnish Shetty
Last edited Nov 5, 2019
Created on Nov 4, 2019
Forked from HTML Cars Reprot

This example builds a bar chart from a CSV file of country populations using D3 v5. It loads the data with `d3.csv`, converts population values to numbers, and creates rectangles via `svg.selectAll('rect').data().enter().append('rect')`. The scale is defined with `scaleLinear`, mapping the maximum population to the SVG width. Though the chart is incomplete—bars have fixed dimensions and no axes—it demonstrates the basic data-binding and scaling pattern for bar charts with SVG rendering.

AI-generated description
MIT Licensed

Similar vizzes