Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart!

Public visualization

Viewing a saved revision (read-only)

8dd69639ea534dbdb17668bd4c9fb5c9

Making a Bar Chart!

0 stars0🌍 Public
GGabriel Meireles
Last edited Aug 14, 2019
Created on Aug 13, 2019

This example shows a horizontal bar chart of the top 10 most populous countries in South America, using population figures from a CSV file. The code loads data with `d3.csv` and renders bars as SVG rectangles, scaled with `d3.scaleLinear` and `d3.scaleBand`. Axes are generated using `d3.axisLeft` and `d3.axisBottom`, with tick labels formatted via `format('.3s')`. A title and axis label are added as SVG text elements, and the chart includes grid lines through the x-axis tick size setting.

AI-generated description