Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

ab7ab7b1fab347ffa782c0f699cb917a

Making a Bar Chart

0 stars2🌍 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