Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

Viewing a saved revision (read-only)

69f728b1e72d4f3eab7dd53f5ffd7010

Making a bar chart

0 stars0🌍 Public
FFahimeh Saleh
Last edited May 25, 2020
Created on May 25, 2020
Forked from Making a bar chart

This example demonstrates how to build a simple bar chart from a CSV dataset of country populations, initially rendering all rectangles with fixed dimensions. The code uses D3 v5’s `scaleLinear` to later map population values to bar widths, while the `csv` method parses the data file and converts population strings to numbers. SVG elements are created via a data join with `selectAll('rect').data().enter()`, though the current implementation only appends static rectangles without encoding data values.

AI-generated description