Skip to main content
100%

making a bar chart

✓ Published0🌍 Public
HHeet Bhatt
Last edited Jun 22, 2023
Created on Jun 21, 2023
Forked from d3

This example displays a bar chart of country populations using a vertical band scale for countries and a linear scale for population values. It reads data from a CSV file, converts population numbers by multiplying them by 1,000, and renders SVG rectangles via d3.select and d3.scaleBand. The chart initially appends rects with hardcoded widths and heights, but the intended layout maps each bar’s width to population through d3.scaleLinear and positions them by country. The code uses d3.csv, d3.max, and d3.scaleLinear, though the final dimensions are not fully computed.

AI-generated description
MIT Licensed

Similar vizzes