Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

making bar chart

Public visualization

Viewing a saved revision (read-only)

d7a139e2e9354f949529824ab7ca903b

making bar chart

0 stars0🌍 Public
Ttayyabanisar
Last edited May 15, 2020
Created on May 15, 2020
Forked from making bar chart

This example shows a static horizontal bar chart ranking the populations of ten countries, with China and India clearly leading and Mexico at the lower end. The chart uses `d3.scaleBand` for the categorical y-axis and `d3.scaleLinear` for the continuous x-axis, rendering bars via SVG `rect` elements with a simple fill color. The code loads the data from a CSV file using `d3.csv`, sorts the entries by population in descending order, and appends labels for each country name alongside its corresponding bar. No axes, gridlines, or interactive features are present, keeping the visualization minimal and focused on the raw values.

AI-generated description