Skip to main content
100%

making bar chart

✓ Published0🌍 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
MIT Licensed

Similar vizzes