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
SShashankC22
Last edited Jul 14, 2020
Created on Jul 14, 2020

This example demonstrates a basic bar chart of country populations, loading data from a CSV file and rendering rectangles into an SVG container. The code uses d3.csv to parse the data, d3.scaleLinear for the x-axis scale, and d3.max to compute the domain. Although the bars are initially appended with fixed widths and heights, the x-scale is correctly configured to map population values to the full SVG width. The chart uses d3 v5 and follows a simple data-join pattern with selection.enter().

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed