Skip to main content
100%

Making a Bar Chart

✓ Published2🌍 Public
CCodeHandLuke
Last edited Aug 13, 2019
Created on Aug 13, 2019
Forked from Making a Bar Chart

This example shows a horizontal bar chart ranking the populations of the world’s ten most populous countries, with bars ordered from China down to Mexico. The visualization uses D3 v5’s `csv` method to load data from a local CSV file, converting population values to absolute numbers before rendering. It builds scales with `scaleLinear` for the x-axis and `scaleBand` for the categorical y-axis, and draws the bars as SVG `rect` elements. Axes are generated using `axisLeft` and `axisBottom`, with the chart laid out inside a configured margin.

AI-generated description
MIT Licensed

Similar vizzes