Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar chart

Public visualization

Making a Bar chart

0 stars0🌍 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

Comments

Sign in to join the discussion.

MIT Licensed